From 39f1dab9ebbeb55bbc65db4f5f1c739d02ab3bb2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 10 Oct 2007 13:17:28 +0200 Subject: r25608: Call security_descriptor_append from within security_descriptor_create. Guenther (This used to be commit 1ebcceb922bdb566e6a548aa1ad816eb8e9e26e9) --- source4/libcli/security/security_descriptor.c | 30 +-------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'source4') diff --git a/source4/libcli/security/security_descriptor.c b/source4/libcli/security/security_descriptor.c index 9723e8ccca..d744f2cc8d 100644 --- a/source4/libcli/security/security_descriptor.c +++ b/source4/libcli/security/security_descriptor.c @@ -387,7 +387,6 @@ struct security_descriptor *security_descriptor_create(TALLOC_CTX *mem_ctx, { va_list ap; struct security_descriptor *sd; - const char *sidstr; sd = security_descriptor_initialise(mem_ctx); if (sd == NULL) return NULL; @@ -410,34 +409,7 @@ struct security_descriptor *security_descriptor_create(TALLOC_CTX *mem_ctx, } va_start(ap, group_sid); - while ((sidstr = va_arg(ap, const char *))) { - struct dom_sid *sid; - struct security_ace *ace = talloc(sd, struct security_ace); - NTSTATUS status; - - if (ace == NULL) { - talloc_free(sd); - va_end(ap); - return NULL; - } - ace->type = va_arg(ap, unsigned int); - ace->access_mask = va_arg(ap, unsigned int); - ace->flags = va_arg(ap, unsigned int); - sid = dom_sid_parse_talloc(ace, sidstr); - if (sid == NULL) { - va_end(ap); - talloc_free(sd); - return NULL; - } - ace->trustee = *sid; - status = security_descriptor_dacl_add(sd, ace); - /* TODO: check: would talloc_free(ace) here be correct? */ - if (!NT_STATUS_IS_OK(status)) { - va_end(ap); - talloc_free(sd); - return NULL; - } - } + sd = security_descriptor_append(sd, ap); va_end(ap); return sd; -- cgit