From e207febf1526d4ac852426cf95ddb72912074c35 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Fri, 9 Sep 2016 16:34:57 +0200 Subject: [PATCH] s3-spoolss: Fix _spoolss_GetPrinter behaviour for server handles. Without this the security tab of the print server properties will be obviously empty and only display a warning. Guenther Signed-off-by: Guenther Deschner Reviewed-by: Stefan Metzmacher --- source3/rpc_server/spoolss/srv_spoolss_nt.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index 4cb2dc7ae2e..743918df743 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -4804,6 +4804,21 @@ WERROR _spoolss_GetPrinter(struct pipes_struct *p, goto err_info_free; } + if (Printer->printer_type == SPLHND_SERVER) { + if (r->in.level != 3) { + result = WERR_UNKNOWN_LEVEL; + goto err_info_free; + } + + result = spoolss_create_default_secdesc(p->mem_ctx, + &r->out.info->info3.secdesc); + if (!W_ERROR_IS_OK(result)) { + goto err_info_free; + } + + goto done; + } + if (!get_printer_snum(p, r->in.handle, &snum, NULL)) { result = WERR_BADFID; goto err_info_free; @@ -4880,7 +4895,7 @@ WERROR _spoolss_GetPrinter(struct pipes_struct *p, r->in.level, win_errstr(result))); goto err_info_free; } - + done: *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_PrinterInfo, r->out.info, r->in.level); r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL); -- 2.34.1