diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-01-24 18:37:24 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-01-24 18:37:24 +1100 |
commit | 6bab4a3810f9b42e62d2fe1a9b1544e34893cb50 (patch) | |
tree | b7123c132f359b1ae1ef76e9e9f519a47941424f /source3 | |
parent | 1a9ee7cbd575f3865a2cd8dfe35e3f89ebdec073 (diff) | |
download | samba-6bab4a3810f9b42e62d2fe1a9b1544e34893cb50.tar.gz samba-6bab4a3810f9b42e62d2fe1a9b1544e34893cb50.tar.bz2 samba-6bab4a3810f9b42e62d2fe1a9b1544e34893cb50.zip |
s3-passdb: Use DSDB_PASSWORD_BYPASS_LAST_SET flags in pdb_samba4
Diffstat (limited to 'source3')
-rw-r--r-- | source3/passdb/pdb_samba4.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source3/passdb/pdb_samba4.c b/source3/passdb/pdb_samba4.c index 8da9b3cf5a..f336b8a9c6 100644 --- a/source3/passdb/pdb_samba4.c +++ b/source3/passdb/pdb_samba4.c @@ -357,6 +357,15 @@ static int pdb_samba4_replace_by_sam(struct pdb_samba4_state *state, return ret; } + /* If we set a plaintext password, the system will + * force the pwdLastSet to now() */ + if (need_update(sam, PDB_PASSLASTSET)) { + dsdb_flags = DSDB_PASSWORD_BYPASS_LAST_SET; + + ret |= pdb_samba4_add_time(msg, "pwdLastSet", + pdb_get_pass_last_set_time(sam)); + } + pw = pdb_get_plaintext_passwd(sam); if (need_update(sam, PDB_PLAINTEXT_PW)) { if (pw == NULL) { @@ -407,15 +416,6 @@ static int pdb_samba4_replace_by_sam(struct pdb_samba4_state *state, } - /* If we set a plaintext password, the system will - * force the pwdLastSet to now(), and it isn't worth - * working around this for the real world use cases of - * pdb_samba4 */ - if (need_update(sam, PDB_PASSLASTSET)) { - ret |= pdb_samba4_add_time(msg, "pwdLastSet", - pdb_get_pass_last_set_time(sam)); - } - if (need_update(sam, PDB_PWHISTORY)) { uint32_t current_hist_len; const uint8_t *history = pdb_get_pw_history(sam, ¤t_hist_len); |