[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-unstable-656-gbc13e93
Jeremy Allison
jra at samba.org
Sat Dec 15 01:03:43 GMT 2007
The branch, v3-2-test has been updated
via bc13e939546a5bcb78925a6b117e89fde20f6451 (commit)
from 56251f78524416435299e26fca405e77d0f42043 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit bc13e939546a5bcb78925a6b117e89fde20f6451
Author: Jeremy Allison <jra at samba.org>
Date: Fri Dec 14 17:02:50 2007 -0800
Fix for bug #5082 from Mathias Gug <mathiaz at ubuntu.com>, Steve Langasek <vorlon at debian.org>.
Recent versions of Linux-PAM support localization of user prompts,
so Samba must use the C locale when invoking PAM (directly or via
/usr/bin/passwd) to ensure that password chat values match the prompts in a
locale-invariant fashion.
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source/smbd/chgpasswd.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/smbd/chgpasswd.c b/source/smbd/chgpasswd.c
index 5a1d71d..58b67a5 100644
--- a/source/smbd/chgpasswd.c
+++ b/source/smbd/chgpasswd.c
@@ -125,6 +125,7 @@ static int dochild(int master, const char *slavedev, const struct passwd *pass,
struct termios stermios;
gid_t gid;
uid_t uid;
+ char * const eptrs[1] = { NULL };
if (pass == NULL)
{
@@ -221,7 +222,7 @@ static int dochild(int master, const char *slavedev, const struct passwd *pass,
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);
@@ -518,6 +519,9 @@ bool chgpasswd(const char *name, const struct passwd *pass,
#ifdef WITH_PAM
if (lp_pam_password_change()) {
bool ret;
+#ifdef HAVE_SETLOCALE
+ const char *prevlocale = setlocale(LC_MESSAGES, "C");
+#endif
if (as_root)
become_root();
@@ -531,6 +535,10 @@ bool chgpasswd(const char *name, const struct passwd *pass,
if (as_root)
unbecome_root();
+#ifdef HAVE_SETLOCALE
+ setlocale(LC_MESSAGES, prevlocale);
+#endif
+
return ret;
}
#endif
--
Samba Shared Repository
More information about the samba-cvs
mailing list