From 40bca3bdd56b58aa5e6117f08dfd3ceb9d113316 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Mon, 26 May 2014 15:46:00 +0200 Subject: s3/net_rpc_printer: replace dup_sec_desc() usage Use security_descriptor_copy() instead, which is also provided by libcli. Signed-off-by: David Disseldorp Reviewed-by: Jeremy Allison Reviewed-by: Volker Lendecke --- source3/utils/net_rpc_printer.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 3cdac6223f..f5247b2935 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -1643,7 +1643,17 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, /* copy secdesc (info level 2) */ info_dst.info2.devmode = NULL; - info_dst.info2.secdesc = dup_sec_desc(mem_ctx, info_src.info3.secdesc); + if (info_src.info3.secdesc == NULL) { + info_dst.info2.secdesc = NULL; + } else { + info_dst.info2.secdesc + = security_descriptor_copy(mem_ctx, + info_src.info3.secdesc); + if (info_dst.info2.secdesc == NULL) { + nt_status = NT_STATUS_NO_MEMORY; + goto done; + } + } if (c->opt_verbose) display_sec_desc(info_dst.info2.secdesc); -- cgit