diff options
author | Andrew Bartlett <abartlet@samba.org> | 2001-10-30 05:21:16 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2001-10-30 05:21:16 +0000 |
commit | 15741d2fe4bafee9100feca2bbf3c133421a2e88 (patch) | |
tree | 72aee2a1d542bd78322d19010e374b415b137dd2 /source3/passdb | |
parent | 160950ae0ec718a4d6ef9932ae2ff175fc8ebbd6 (diff) | |
download | samba-15741d2fe4bafee9100feca2bbf3c133421a2e88.tar.gz samba-15741d2fe4bafee9100feca2bbf3c133421a2e88.tar.xz samba-15741d2fe4bafee9100feca2bbf3c133421a2e88.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
(This used to be commit cea6b6cb228c7e1f0c2d45951590e0d8fb8b315c)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/passdb.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index c58afc1f896..6a96426a9f1 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -919,13 +919,6 @@ account without a valid local system user.\n", user_name); return False; } } else if (local_flags & LOCAL_ENABLE_USER) { - if (pdb_get_lanman_passwd(sam_pass) == NULL) { - if (!pdb_set_plaintext_passwd (sam_pass, new_passwd)) { - slprintf(err_str, err_str_len-1, "Failed to set password for user %s.\n", user_name); - pdb_free_sam(&sam_pass); - return False; - } - } if (!pdb_set_acct_ctrl (sam_pass, pdb_get_acct_ctrl(sam_pass)&(~ACB_DISABLED))) { slprintf(err_str, err_str_len-1, "Failed to unset 'disabled' flag for user %s.\n", user_name); pdb_free_sam(&sam_pass); @@ -939,19 +932,7 @@ account without a valid local system user.\n", user_name); pdb_free_sam(&sam_pass); return False; } - - /* This is needed to preserve ACB_PWNOTREQ in mod_smbfilepwd_entry */ - if (!pdb_set_lanman_passwd (sam_pass, NULL)) { - slprintf(err_str, err_str_len-1, "Failed to set NULL lanman password for user %s.\n", user_name); - pdb_free_sam(&sam_pass); - return False; - } - if (!pdb_set_nt_passwd (sam_pass, NULL)) { - slprintf(err_str, err_str_len-1, "Failed to set NULL NT password for user %s.\n", user_name); - pdb_free_sam(&sam_pass); - return False; - } - } else { + } else if (local_flags & LOCAL_SET_PASSWORD) { /* * If we're dealing with setting a completely empty user account * ie. One with a password of 'XXXX', but not set disabled (like |