From: Jo Sutton Date: Thu, 9 May 2024 01:53:00 +0000 (+1200) Subject: s4:dsdb: Make use of userAccountControl helper function X-Git-Tag: tdb-1.4.11~654 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c759c2675231bf5ef8e6ebe57c118ec36047bdb;p=thirdparty%2Fsamba.git s4:dsdb: Make use of userAccountControl helper function Signed-off-by: Jo Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c index e71728da8bc..f27eedef0d3 100644 --- a/source4/dsdb/samdb/ldb_modules/operational.c +++ b/source4/dsdb/samdb/ldb_modules/operational.c @@ -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,