summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-10-10 13:17:28 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:42:51 +0100
commit39f1dab9ebbeb55bbc65db4f5f1c739d02ab3bb2 (patch)
tree1ae68f9ce718677ef425eb5c64bec288714f4653 /source4
parenta6c4b9d1793c7ea1965a23e1d23b73012acd151b (diff)
downloadsamba-39f1dab9ebbeb55bbc65db4f5f1c739d02ab3bb2.tar.gz
samba-39f1dab9ebbeb55bbc65db4f5f1c739d02ab3bb2.tar.bz2
samba-39f1dab9ebbeb55bbc65db4f5f1c739d02ab3bb2.zip
r25608: Call security_descriptor_append from within security_descriptor_create.
Guenther (This used to be commit 1ebcceb922bdb566e6a548aa1ad816eb8e9e26e9)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/security/security_descriptor.c30
1 files changed, 1 insertions, 29 deletions
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;