]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb: Add userAccountControl helper function
authorJo Sutton <josutton@catalyst.net.nz>
Wed, 1 May 2024 00:38:04 +0000 (12:38 +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/common/util.c

index d3fb3024db0dc5bf07ec58727591c1a2315df56b..12528256f2cffc06bc9ca58894fe63fd2f36115d 100644 (file)
@@ -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;
+}