1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

r25801: Add security_ace_create() function.

Guenther
This commit is contained in:
Günther Deschner 2007-11-02 11:51:26 +01:00 committed by Stefan Metzmacher
parent c44a1d8393
commit 0306e0183d

View File

@ -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;
}