diff options
author | Tim Prouty <tprouty@samba.org> | 2008-11-04 18:08:03 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2008-12-09 14:51:48 -0800 |
commit | 6153f622af0cd7855ca349f73307988c1b9478b8 (patch) | |
tree | 061ec1daaceba2cfe933ef42c9e9e6a908ba17e6 /source3/lib/secdesc.c | |
parent | d5d9d3dc0e2c85ab608972cfa8e41122504fb75e (diff) | |
download | samba-6153f622af0cd7855ca349f73307988c1b9478b8.tar.gz |
s3: Refactor getting sec_info from a security_descriptor into separate function
Diffstat (limited to 'source3/lib/secdesc.c')
-rw-r--r-- | source3/lib/secdesc.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/lib/secdesc.c b/source3/lib/secdesc.c index df85336603..400f5f31b0 100644 --- a/source3/lib/secdesc.c +++ b/source3/lib/secdesc.c @@ -100,6 +100,33 @@ bool sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2) } /******************************************************************* + Given a security_descriptor return the sec_info. +********************************************************************/ + +uint32_t get_sec_info(const SEC_DESC *sd) +{ + uint32_t sec_info = ALL_SECURITY_INFORMATION; + + SMB_ASSERT(sd); + + if (sd->owner_sid == NULL) { + sec_info &= ~OWNER_SECURITY_INFORMATION; + } + if (sd->group_sid == NULL) { + sec_info &= ~GROUP_SECURITY_INFORMATION; + } + if (sd->sacl == NULL) { + sec_info &= ~SACL_SECURITY_INFORMATION; + } + if (sd->dacl == NULL) { + sec_info &= ~DACL_SECURITY_INFORMATION; + } + + return sec_info; +} + + +/******************************************************************* Merge part of security descriptor old_sec in to the empty sections of security descriptor new_sec. ********************************************************************/ |