s4:dsdb/samldb: remove fantasy code from samldb_user_account_control_change()
authorStefan Metzmacher <metze@samba.org>
Tue, 1 Apr 2014 08:54:27 +0000 (10:54 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 2 Apr 2014 15:12:47 +0000 (17:12 +0200)
Setting UF_PASSWORD_EXPIRED doesn't reset "pwdLastSet" to "0"!

Change-Id: I9e004195ad864b8b3fe036986b1087398d1f6fc5
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/samldb.c

index a8dcf91f23cbfbe612a109552f1047626584aca0..c2fcdbbad5d42548ca6c7729303052b258e814f7 100644 (file)
@@ -1573,16 +1573,6 @@ static int samldb_user_account_control_change(struct samldb_ctx *ac)
                uac_generated = true;
        }
        if ((user_account_control & UF_PASSWORD_EXPIRED) != 0) {
-               /* "pwdLastSet" reset as password expiration has been forced  */
-               ldb_msg_remove_attr(ac->msg, "pwdLastSet");
-               ret = samdb_msg_add_uint64(ldb, ac->msg, ac->msg, "pwdLastSet",
-                                          (NTTIME)0);
-               if (ret != LDB_SUCCESS) {
-                       return ret;
-               }
-               el = ldb_msg_find_element(ac->msg, "pwdLastSet");
-               el->flags = LDB_FLAG_MOD_REPLACE;
-
                user_account_control &= ~UF_PASSWORD_EXPIRED;
                uac_generated = true;
        }