summaryrefslogtreecommitdiffstats
path: root/source/pam_smbpass
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-10-30 05:21:16 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-10-30 05:21:16 +0000
commitcea6b6cb228c7e1f0c2d45951590e0d8fb8b315c (patch)
tree7a1aa590bdac6330f7b6f5b7950943aed8006a36 /source/pam_smbpass
parentc3f5df8d6743bb7b48118b378f23268008e74145 (diff)
downloadsamba-cea6b6cb228c7e1f0c2d45951590e0d8fb8b315c.tar.gz
samba-cea6b6cb228c7e1f0c2d45951590e0d8fb8b315c.tar.xz
samba-cea6b6cb228c7e1f0c2d45951590e0d8fb8b315c.zip
Fix up smbpasswd -e/-d so that it doesn't change the password under you any
more. (Previously it set them to 'XXXX' or similar when only the flags were being changed - a bug I must have introduced when I reworked the passdb end of things a few weeks back.) Adds a new local flag: LOCAL_SET_PASSWORD to specify that the password is actually to be changed. Andrew Bartlett
Diffstat (limited to 'source/pam_smbpass')
-rw-r--r--source/pam_smbpass/pam_smb_auth.c4
-rw-r--r--source/pam_smbpass/pam_smb_passwd.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/source/pam_smbpass/pam_smb_auth.c b/source/pam_smbpass/pam_smb_auth.c
index 3126bebb346..82799150777 100644
--- a/source/pam_smbpass/pam_smb_auth.c
+++ b/source/pam_smbpass/pam_smb_auth.c
@@ -187,7 +187,7 @@ static int _smb_add_user(pam_handle_t *pamh, unsigned int ctrl,
/* Add the user to the db if they aren't already there. */
if (smb_pwent == NULL) {
- retval = local_password_change( name, LOCAL_ADD_USER,
+ retval = local_password_change( name, LOCAL_ADD_USER|LOCAL_SET_PASSWORD,
pass, err_str,
sizeof(err_str),
msg_str, sizeof(msg_str) );
@@ -209,7 +209,7 @@ static int _smb_add_user(pam_handle_t *pamh, unsigned int ctrl,
/* Change the user's password IFF it's null. */
if (smb_pwent->smb_passwd == NULL && (smb_pwent->acct_ctrl & ACB_PWNOTREQ))
{
- retval = local_password_change( name, 0,
+ retval = local_password_change( name, LOCAL_SET_PASSWORD,
pass, err_str,
sizeof(err_str),
msg_str, sizeof(msg_str) );
diff --git a/source/pam_smbpass/pam_smb_passwd.c b/source/pam_smbpass/pam_smb_passwd.c
index 3a987684f16..9d0b13d6cee 100644
--- a/source/pam_smbpass/pam_smb_passwd.c
+++ b/source/pam_smbpass/pam_smb_passwd.c
@@ -44,7 +44,7 @@ int smb_update_db( pam_handle_t *pamh, int ctrl, const char *user
err_str[0] = '\0';
msg_str[0] = '\0';
- retval = local_password_change( user, 0, pass_new, err_str, sizeof(err_str),
+ retval = local_password_change( user, LOCAL_SET_PASSWORD, pass_new, err_str, sizeof(err_str),
msg_str, sizeof(msg_str) );
if (!retval) {