summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr_nt.c
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2007-06-26 20:09:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:36 -0500
commit9c3db7adf3efb7e485ac0a7301f31a1ab6338435 (patch)
tree43872efb41a9ca0ce4fe74c47bf52d12a258d01c /source3/rpc_server/srv_samr_nt.c
parent53637791023ec35f669244d7ea24ceaf6cf30d18 (diff)
downloadsamba-9c3db7adf3efb7e485ac0a7301f31a1ab6338435.tar.gz
samba-9c3db7adf3efb7e485ac0a7301f31a1ab6338435.tar.bz2
samba-9c3db7adf3efb7e485ac0a7301f31a1ab6338435.zip
r23616: Fix bugzilla #4719: must change password is not set from usrmgr.exe.
This was only affecting the newer versions of usrmgr.exe, because they use a user_info_25 struct. The password is getting set separately inside that code, so the password last set time was getting set from the password change logic. We also were not parsing a number of fields (like logon hours) from the user_info_25. That should also be fixed. (This used to be commit afabd68b6ae874aceba708dc36808ed007ad496c)
Diffstat (limited to 'source3/rpc_server/srv_samr_nt.c')
-rw-r--r--source3/rpc_server/srv_samr_nt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index b392f289a8..e28fc59136 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -3357,11 +3357,17 @@ static BOOL set_user_info_pw(uint8 *pass, struct samu *pwd)
uint32 len;
pstring plaintext_buf;
uint32 acct_ctrl;
+ time_t last_set_time;
+ enum pdb_value_state last_set_state;
DEBUG(5, ("Attempting administrator password change for user %s\n",
pdb_get_username(pwd)));
acct_ctrl = pdb_get_acct_ctrl(pwd);
+ /* we need to know if it's expired, because this is an admin change, not a
+ user change, so it's still expired when we're done */
+ last_set_state = pdb_get_init_flags(pwd, PDB_PASSLASTSET);
+ last_set_time = pdb_get_pass_last_set_time(pwd);
ZERO_STRUCT(plaintext_buf);
@@ -3404,6 +3410,9 @@ static BOOL set_user_info_pw(uint8 *pass, struct samu *pwd)
ZERO_STRUCT(plaintext_buf);
+ /* restore last set time as this is an admin change, not a user pw change */
+ pdb_set_pass_last_set_time (pwd, last_set_time, last_set_state);
+
DEBUG(5,("set_user_info_pw: pdb_update_pwd()\n"));
/* update the SAMBA password */