diff options
author | Günther Deschner <gd@samba.org> | 2007-11-02 11:51:26 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:44:04 +0100 |
commit | 2342d611ace6e2a76cfd7e0cf408d3a497c89ba0 (patch) | |
tree | 1247e0d1fe1b08b33ecca31e344978a4802fecc5 /source4 | |
parent | f05a356cbbdd4b0f3b7775338f288b2756f5fc24 (diff) | |
download | samba-2342d611ace6e2a76cfd7e0cf408d3a497c89ba0.tar.gz samba-2342d611ace6e2a76cfd7e0cf408d3a497c89ba0.tar.bz2 samba-2342d611ace6e2a76cfd7e0cf408d3a497c89ba0.zip |
r25801: Add security_ace_create() function.
Guenther
(This used to be commit 0306e0183d4db0da331449b411814e7a93b6db2d)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/libcli/security/security_descriptor.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source4/libcli/security/security_descriptor.c b/source4/libcli/security/security_descriptor.c index 75c20b52cf..34ccab593d 100644 --- a/source4/libcli/security/security_descriptor.c +++ b/source4/libcli/security/security_descriptor.c @@ -422,3 +422,32 @@ struct security_descriptor *security_descriptor_create(TALLOC_CTX *mem_ctx, return sd; } + +struct security_ace *security_ace_create(TALLOC_CTX *mem_ctx, + const char *sid_str, + enum security_ace_type type, + uint32_t access_mask, + uint8_t flags) + +{ + struct dom_sid *sid; + struct security_ace *ace; + + ace = talloc_zero(mem_ctx, struct security_ace); + if (ace == NULL) { + return NULL; + } + + sid = dom_sid_parse_talloc(ace, sid_str); + if (sid == NULL) { + talloc_free(ace); + return NULL; + } + + ace->trustee = *sid; + ace->type = type; + ace->access_mask = access_mask; + ace->flags = flags; + + return ace; +} |