]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/security: helper to find resource attribute ACEs
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 23 Aug 2023 00:44:26 +0000 (12:44 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Sep 2023 23:45:35 +0000 (23:45 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
libcli/security/secace.c
libcli/security/secace.h

index 8d7b22d1f6885a0085d1de25202b49aebc33890b..e6ac6572ba2e746a6aeca9f692ba2a5e8b2c5f96 100644 (file)
@@ -64,6 +64,15 @@ bool sec_ace_callback(uint8_t type)
        return false;
 }
 
+/**
+ * Check if an ACE type is resource attribute, which means it will
+ * have a blob of data at the end defining an attribute on the object.
+ * Resource attribute ACEs should only occur in SACLs.
+ */
+bool sec_ace_resource(uint8_t type)
+{
+       return type == SEC_ACE_TYPE_SYSTEM_RESOURCE_ATTRIBUTE;
+}
 
 /*******************************************************************
  Sets up a struct security_ace structure.
index 6b2e8995ea07dedf08366647b48f6df5f6fa297f..97be534873571e7507c87fbc9e102cbb25b24634 100644 (file)
@@ -26,6 +26,7 @@
 bool sec_ace_object(uint8_t type);
 size_t ndr_subcontext_size_of_ace_coda(const struct security_ace *ace, size_t ace_size, int flags);
 bool sec_ace_callback(uint8_t type);
+bool sec_ace_resource(uint8_t type);
 
 void init_sec_ace(struct security_ace *t, const struct dom_sid *sid, enum security_ace_type type,
                  uint32_t mask, uint8_t flag);