[Pkg-samba-maint] Bug#451272: localized pam == no samba password changing

Mathias Gug mathiaz at ubuntu.com
Wed Nov 14 17:44:50 UTC 2007


Package: samba 
Version: 3.0.26a-1
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch hardy


To apply password change requests from Samba clients to system passwords and
not just to Samba passwords, Samba invokes PAM either directly or by way of
/usr/bin/passwd and is configured to know how to communicate with PAM modules
using expect-style rules (smb.conf setting "passwd chat"). Version 0.99.7.1 of
pam includes l10n support, which means that the prompts generated by PAM
modules are now different for each locale. To account for this, Samba should
explicitly use the C locale when attempting a password sync and restore the
user's locale setting afterwards.

First reported in Ubuntu:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/139265

-------------- next part --------------
=== added file 'trunk/samba/debian/patches/chgpasswd.patch'
--- trunk/samba/debian/patches/chgpasswd.patch	1970-01-01 00:00:00 +0000
+++ trunk/samba/debian/patches/chgpasswd.patch	2007-11-13 17:43:17 +0000
@@ -0,0 +1,41 @@
+Index: samba-3.0.26a/source/smbd/chgpasswd.c
+===================================================================
+--- samba-3.0.26a.orig/source/smbd/chgpasswd.c
++++ samba-3.0.26a/source/smbd/chgpasswd.c
+@@ -126,6 +126,7 @@
+ 	struct termios stermios;
+ 	gid_t gid;
+ 	uid_t uid;
++	char *eptrs[1] = { NULL };
+ 
+ 	if (pass == NULL)
+ 	{
+@@ -222,7 +223,7 @@
+ 	       passwordprogram));
+ 
+ 	/* execl() password-change application */
+-	if (execl("/bin/sh", "sh", "-c", passwordprogram, NULL) < 0)
++	if (execle("/bin/sh", "sh", "-c", passwordprogram, NULL, eptrs) < 0)
+ 	{
+ 		DEBUG(3, ("Bad status returned from %s\n", passwordprogram));
+ 		return (False);
+@@ -498,6 +499,9 @@
+ #ifdef WITH_PAM
+ 	if (lp_pam_password_change()) {
+ 		BOOL ret;
++#ifdef HAVE_SETLOCALE
++		char *prevlocale = setlocale(LC_MESSAGES, "C");
++#endif
+ 
+ 		if (as_root)
+ 			become_root();
+@@ -511,6 +515,9 @@
+ 		if (as_root)
+ 			unbecome_root();
+ 
++#ifdef HAVE_SETLOCALE
++		setlocale(LC_MESSAGES, prevlocale);
++#endif
+ 		return ret;
+ 	}
+ #endif

=== modified file 'trunk/samba/debian/patches/series'
--- trunk/samba/debian/patches/series	2007-11-12 21:58:04 +0000
+++ trunk/samba/debian/patches/series	2007-11-13 17:44:03 +0000
@@ -24,3 +24,4 @@
 smbpasswd-syslog.patch
 get_global_sam_sid-non-root.patch
 usershare.patch
+chgpasswd.patch



More information about the Pkg-samba-maint mailing list