Author: gd
Date: 2007-10-10 13:17:28 +0000 (Wed, 10 Oct 2007)
New Revision: 25608

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25608

Log:
Call security_descriptor_append from within security_descriptor_create.

Guenther

Modified:
   branches/SAMBA_4_0/source/libcli/security/security_descriptor.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/security/security_descriptor.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/security/security_descriptor.c     
2007-10-10 13:12:53 UTC (rev 25607)
+++ branches/SAMBA_4_0/source/libcli/security/security_descriptor.c     
2007-10-10 13:17:28 UTC (rev 25608)
@@ -387,7 +387,6 @@
 {
        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 @@
        }
 
        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;

Reply via email to