diff options
author | David Disseldorp <ddiss@samba.org> | 2014-05-26 15:48:34 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-05-28 17:52:13 +0200 |
commit | 4be7800801586eb404e5f96e853fe6dbe7c3f82f (patch) | |
tree | b6ba050f8628c218ad1513ac5ec1a5ef003315b2 | |
parent | 0c5911fc78beb788ad43e59f1722a734e9e6bb7e (diff) | |
download | samba-4be7800801586eb404e5f96e853fe6dbe7c3f82f.tar.gz samba-4be7800801586eb404e5f96e853fe6dbe7c3f82f.tar.xz samba-4be7800801586eb404e5f96e853fe6dbe7c3f82f.zip |
s3/rpc_server/spoolss: replace dup_sec_desc() usage
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>
Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_nt.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index 588aae4eb90..760c924d80f 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -2935,7 +2935,12 @@ static void spoolss_notify_security_desc(struct messaging_context *msg_ctx, struct spoolss_PrinterInfo2 *pinfo2, TALLOC_CTX *mem_ctx) { - data->data.sd.sd = dup_sec_desc(mem_ctx, pinfo2->secdesc); + if (pinfo2->secdesc == NULL) { + data->data.sd.sd = NULL; + } else { + data->data.sd.sd = security_descriptor_copy(mem_ctx, + pinfo2->secdesc); + } data->data.sd.sd_size = ndr_size_security_descriptor(data->data.sd.sd, 0); } @@ -4071,7 +4076,10 @@ static WERROR construct_printer_info2(TALLOC_CTX *mem_ctx, /* don't use talloc_steal() here unless you do a deep steal of all the SEC_DESC members */ - r->secdesc = dup_sec_desc(mem_ctx, info2->secdesc); + r->secdesc = security_descriptor_copy(mem_ctx, info2->secdesc); + if (r->secdesc == NULL) { + return WERR_NOMEM; + } } return WERR_OK; @@ -4094,8 +4102,10 @@ static WERROR construct_printer_info3(TALLOC_CTX *mem_ctx, /* don't use talloc_steal() here unless you do a deep steal of all the SEC_DESC members */ - r->secdesc = dup_sec_desc(mem_ctx, info2->secdesc); - W_ERROR_HAVE_NO_MEMORY(r->secdesc); + r->secdesc = security_descriptor_copy(mem_ctx, info2->secdesc); + if (r->secdesc == NULL) { + return WERR_NOMEM; + } } return WERR_OK; |