1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:dsdb: Make use of userAccountControl helper function

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Jo Sutton 2024-05-09 13:53:00 +12:00 committed by Andrew Bartlett
parent 1b8b8550aa
commit 4c759c2675

View 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,