summaryrefslogtreecommitdiffstats
path: root/source/smbd/chgpasswd.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-30 20:37:44 +0000
committerJeremy Allison <jra@samba.org>2001-04-30 20:37:44 +0000
commitbda358eaa27aae4a0feb2c37f86845722d29361a (patch)
tree9a230798a5bcac6f3448d85242551a71c16a9c1e /source/smbd/chgpasswd.c
parentb1e6176edef398133eb2a070cc0ae6713510023a (diff)
downloadsamba-bda358eaa27aae4a0feb2c37f86845722d29361a.tar.gz
samba-bda358eaa27aae4a0feb2c37f86845722d29361a.tar.xz
samba-bda358eaa27aae4a0feb2c37f86845722d29361a.zip
Based on an original PAM patch by Andrew Bartlett, re-written by me to
remove global static PAM variables, and to tidy up the PAM internals code. Now looks like the rest of Samba. Still needs testing. Jeremy.
Diffstat (limited to 'source/smbd/chgpasswd.c')
-rw-r--r--source/smbd/chgpasswd.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/smbd/chgpasswd.c b/source/smbd/chgpasswd.c
index 63f425f4cc3..1b879890813 100644
--- a/source/smbd/chgpasswd.c
+++ b/source/smbd/chgpasswd.c
@@ -53,6 +53,24 @@ extern int DEBUGLEVEL;
#if ALLOW_CHANGE_PASSWORD
+#ifdef WITH_PAM
+BOOL chgpasswd(char *name, char *oldpass, char *newpass, BOOL as_root)
+{
+ BOOL ret;
+
+ if (as_root)
+ become_root();
+
+ ret = smb_pam_passchange(name, oldpass, newpass);
+
+ if (as_root)
+ unbecome_root();
+
+ return ret;
+}
+
+#else /* WITH_PAM */
+
static int findpty(char **slave)
{
int master;
@@ -526,7 +544,10 @@ BOOL chgpasswd(char *name, char *oldpass, char *newpass, BOOL as_root)
(passwordprogram, name, chatsequence, as_root));
}
+#endif /* WITH_PAM */
+
#else /* ALLOW_CHANGE_PASSWORD */
+
BOOL chgpasswd(char *name, char *oldpass, char *newpass, BOOL as_root)
{
DEBUG(0, ("Password changing not compiled in (user=%s)\n", name));