summaryrefslogtreecommitdiff
path: root/source3/lib/secdesc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/secdesc.c')
-rw-r--r--source3/lib/secdesc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/lib/secdesc.c b/source3/lib/secdesc.c
index 5e35181834..d45be00212 100644
--- a/source3/lib/secdesc.c
+++ b/source3/lib/secdesc.c
@@ -474,6 +474,26 @@ static bool is_inheritable_ace(const SEC_ACE *ace,
return false;
}
+/*
+ * Does a security descriptor have any inheritable components for
+ * the newly created type ?
+ */
+
+bool sd_has_inheritable_components(const SEC_DESC *parent_ctr, bool container)
+{
+ unsigned int i;
+ const SEC_ACL *the_acl = parent_ctr->dacl;
+
+ for (i = 0; i < the_acl->num_aces; i++) {
+ const SEC_ACE *ace = &the_acl->aces[i];
+
+ if (is_inheritable_ace(ace, container)) {
+ return true;
+ }
+ }
+ return false;
+}
+
/* Create a child security descriptor using another security descriptor as
the parent container. This child object can either be a container or
non-container object. */