From 0306e0183d4db0da331449b411814e7a93b6db2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Fri, 2 Nov 2007 11:51:26 +0100 Subject: [PATCH] r25801: Add security_ace_create() function. Guenther --- source/libcli/security/security_descriptor.c | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/source/libcli/security/security_descriptor.c b/source/libcli/security/security_descriptor.c index 75c20b52cfb..34ccab593d5 100644 --- a/source/libcli/security/security_descriptor.c +++ b/source/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; +}