From 4c759c2675231bf5ef8e6ebe57c118ec36047bdb Mon Sep 17 00:00:00 2001 From: Jo Sutton Date: Thu, 9 May 2024 13:53:00 +1200 Subject: [PATCH] s4:dsdb: Make use of userAccountControl helper function Signed-off-by: Jo Sutton Reviewed-by: Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/operational.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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,