]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-smbd: Initialize the print backend after we setup winreg.
authorAndreas Schneider <asn@samba.org>
Tue, 28 Aug 2012 12:53:01 +0000 (14:53 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 29 Aug 2012 08:09:33 +0000 (10:09 +0200)
The print backend init also migrates the printing tdb to winreg. For
this we need to setup the winreg pipe first.

Signed-off-by: Andreas Schneider <asn@samba.org>
Fix bug #9122 - winreg_printer_openkey: Could not open HKLM hive:
NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE.

source3/smbd/server.c

index 9a8cdc0b60e47260a609b4cde38f82ec52cb2156..2400ce45a896dc062f8bacc49ca08905a7a18f13 100644 (file)
@@ -1228,9 +1228,6 @@ extern void build_options(bool screen);
                return -1;
        }
 
-       if (!print_backend_init(smbd_messaging_context()))
-               exit(1);
-
        if (!init_guest_info()) {
                DEBUG(0,("ERROR: failed to setup guest info.\n"));
                return -1;
@@ -1257,6 +1254,13 @@ extern void build_options(bool screen);
                exit(1);
        }
 
+       /*
+        * The print backend init also migrates the printing tdb's,
+        * this requires a winreg pipe.
+        */
+       if (!print_backend_init(smbd_messaging_context()))
+               exit(1);
+
        /* Publish nt printers, this requires a working winreg pipe */
        pcap_cache_reload(server_event_context(), smbd_messaging_context(),
                          &reload_printers);