libgpo: replace dup_sec_desc() usage
authorDavid Disseldorp <ddiss@samba.org>
Mon, 26 May 2014 13:48:34 +0000 (15:48 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 28 May 2014 15:52:13 +0000 (17:52 +0200)
Use security_descriptor_copy() instead, which is also provided by
libcli.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libgpo/gpo_util.c

index 5b801c4b08603d209b57978b5108acbcfeff7c88..e90b9a3f244e7317335785e2ea890e12631283e0 100644 (file)
@@ -773,7 +773,13 @@ NTSTATUS gpo_copy(TALLOC_CTX *mem_ctx,
                }
        }
 
-       gpo->security_descriptor = dup_sec_desc(gpo, gpo_src->security_descriptor);
+       if (gpo_src->security_descriptor == NULL) {
+               /* existing SD assumed */
+               TALLOC_FREE(gpo);
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+       gpo->security_descriptor = security_descriptor_copy(gpo,
+                                               gpo_src->security_descriptor);
        if (gpo->security_descriptor == NULL) {
                TALLOC_FREE(gpo);
                return NT_STATUS_NO_MEMORY;