summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/chgpasswd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index 5a1d71d2af..58b67a58cd 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/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