From: Jo Sutton Date: Wed, 1 May 2024 00:38:04 +0000 (+1200) Subject: s4:dsdb: Add userAccountControl helper function X-Git-Tag: tdb-1.4.11~655 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b8b8550aaa909d27504ea80bd2b1e4f40092081;p=thirdparty%2Fsamba.git s4:dsdb: Add userAccountControl helper function Signed-off-by: Jo Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index d3fb3024db0..12528256f2c 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -7012,3 +7012,13 @@ int dsdb_is_protected_user(struct ldb_context *ldb, return 0; } + +bool dsdb_account_is_trust(const struct ldb_message *msg) +{ + uint32_t userAccountControl; + + userAccountControl = ldb_msg_find_attr_as_uint(msg, + "userAccountControl", + 0); + return userAccountControl & UF_TRUST_ACCOUNT_MASK; +}