cli_winreg_spoolss: handle also printer sharename
authorBjörn Jacke <bj@sernet.de>
Mon, 7 Sep 2020 18:09:56 +0000 (20:09 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 18 Sep 2020 00:35:40 +0000 (00:35 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9771

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_client/cli_winreg_spoolss.c

index 7a0817a176a1acb2adcf7d368e356aff80e9883e..3b66e20676db12e2324b46dbaca6f6f6774215f8 100644 (file)
@@ -857,6 +857,19 @@ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx,
                                goto done;
                        }
 
+                       status = dcerpc_winreg_set_sz(tmp_ctx,
+                                                     winreg_handle,
+                                                     &key_hnd,
+                                                     SPOOL_REG_PRINTSHARENAME,
+                                                     sharename,
+                                                     &result);
+                       if (!NT_STATUS_IS_OK(status)) {
+                               result = ntstatus_to_werror(status);
+                       }
+                       if (!W_ERROR_IS_OK(result)) {
+                               goto done;
+                       }
+
                        status = dcerpc_winreg_set_sz(tmp_ctx,
                                                      winreg_handle,
                                                      &key_hnd,