[PATCH 12/13] libcli/secdesc: replace dup_sec_desc() usage

David Disseldorp ddiss at samba.org
Mon May 26 09:30:02 MDT 2014


Use security_descriptor_copy() instead, which is also provided by
libcli.

Signed-off-by: David Disseldorp <ddiss at samba.org>
---
 libcli/security/secdesc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libcli/security/secdesc.c b/libcli/security/secdesc.c
index 31d134b..72ba2db 100644
--- a/libcli/security/secdesc.c
+++ b/libcli/security/secdesc.c
@@ -405,8 +405,11 @@ struct sec_desc_buf *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, struct secur
 	/* max buffer size (allocated size) */
 	dst->sd_size = (uint32_t)len;
 
-	if(sec_desc && ((dst->sd = dup_sec_desc(ctx, sec_desc)) == NULL)) {
-		return NULL;
+	if (sec_desc != NULL) {
+		dst->sd = security_descriptor_copy(ctx, sec_desc);
+		if (dst->sd == NULL) {
+			return NULL;
+		}
 	}
 
 	return dst;
-- 
1.8.4.5



More information about the samba-technical mailing list