From 15741d2fe4bafee9100feca2bbf3c133421a2e88 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 30 Oct 2001 05:21:16 +0000 Subject: 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) --- source3/passdb/passdb.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'source3/passdb/passdb.c') diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index c58afc1f89..6a96426a9f 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 -- cgit