s4:dsdb/common: remove unused samdb_result_force_password_change()
authorStefan Metzmacher <metze@samba.org>
Fri, 3 Jun 2016 22:53:45 +0000 (00:53 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 30 Jun 2016 01:30:23 +0000 (03:30 +0200)
The logic is incomplete and the correct logic is already available
via the constructed "msDS-UserPasswordExpiryTimeComputed" attribute.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11441

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/common/util.c

index 4ad827a212a821ad99577cb9c425cde3b5563cbb..5be340a2525c6f39daf462a1a8aa1a444bdf428f 100644 (file)
@@ -475,45 +475,6 @@ NTTIME samdb_result_allow_password_change(struct ldb_context *sam_ldb,
        return attr_time;
 }
 
-/*
-  construct the force_password_change field from the PwdLastSet
-  attribute, the userAccountControl and the domain password settings
-*/
-NTTIME samdb_result_force_password_change(struct ldb_context *sam_ldb, 
-                                         TALLOC_CTX *mem_ctx, 
-                                         struct ldb_dn *domain_dn, 
-                                         struct ldb_message *msg)
-{
-       int64_t attr_time = ldb_msg_find_attr_as_int64(msg, "pwdLastSet", 0);
-       uint32_t userAccountControl = ldb_msg_find_attr_as_uint(msg,
-                                                               "userAccountControl",
-                                                               0);
-       int64_t maxPwdAge;
-
-       /* Machine accounts don't expire, and there is a flag for 'no expiry' */
-       if (!(userAccountControl & UF_NORMAL_ACCOUNT)
-           || (userAccountControl & UF_DONT_EXPIRE_PASSWD)) {
-               return 0x7FFFFFFFFFFFFFFFULL;
-       }
-
-       if (attr_time == 0) {
-               return 0;
-       }
-       if (attr_time == -1) {
-               return 0x7FFFFFFFFFFFFFFFULL;
-       }
-
-       maxPwdAge = samdb_search_int64(sam_ldb, mem_ctx, 0, domain_dn,
-                                      "maxPwdAge", NULL);
-       if (maxPwdAge == 0 || maxPwdAge == -0x8000000000000000ULL) {
-               return 0x7FFFFFFFFFFFFFFFULL;
-       } else {
-               attr_time -= maxPwdAge;
-       }
-
-       return attr_time;
-}
-
 /*
   pull a samr_Password structutre from a result set. 
 */