s3-spoolss: Fix _spoolss_GetPrinter behaviour for server handles.
authorGünther Deschner <gd@samba.org>
Fri, 9 Sep 2016 14:34:57 +0000 (16:34 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 22 Sep 2016 10:29:27 +0000 (12:29 +0200)
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 <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_server/spoolss/srv_spoolss_nt.c

index 4cb2dc7ae2e8d4220a52096a1d31c60263a5b9fa..743918df743f4b082735c1ef720e0d845dea8489 100644 (file)
@@ -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);