From 6bab4a3810f9b42e62d2fe1a9b1544e34893cb50 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 24 Jan 2012 18:37:24 +1100 Subject: s3-passdb: Use DSDB_PASSWORD_BYPASS_LAST_SET flags in pdb_samba4 --- source3/passdb/pdb_samba4.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source3/passdb') 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); -- cgit