]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb: Make use of userAccountControl helper function
authorJo Sutton <josutton@catalyst.net.nz>
Thu, 9 May 2024 01:53:00 +0000 (13:53 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 16 May 2024 02:11:36 +0000 (02:11 +0000)
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/operational.c

index e71728da8bcdabe6fe4ef5b0fedce32cf533661f..f27eedef0d359ddac677a5f047cc21a213d26ba0 100644 (file)
@@ -879,10 +879,7 @@ static int construct_msds_user_account_control_computed(struct ldb_module *modul
        /* Test account expire time */
        unix_to_nt_time(&now, time(NULL));
 
-       userAccountControl = ldb_msg_find_attr_as_uint(msg,
-                                                      "userAccountControl",
-                                                      0);
-       if (!(userAccountControl & UF_TRUST_ACCOUNT_MASK)) {
+       if (!dsdb_account_is_trust(msg)) {
 
                int64_t lockoutTime = ldb_msg_find_attr_as_int64(msg, "lockoutTime", 0);
                if (lockoutTime != 0) {
@@ -901,6 +898,9 @@ static int construct_msds_user_account_control_computed(struct ldb_module *modul
                }
        }
 
+       userAccountControl = ldb_msg_find_attr_as_uint(msg,
+                                                      "userAccountControl",
+                                                      0);
        if (!(userAccountControl & _UF_NO_EXPIRY_ACCOUNTS)) {
                NTTIME must_change_time
                        = get_msds_user_password_expiry_time_computed(module,