s3:printing only do printing_subsystem_update when printing is enabled
authorChristian Ambach <ambi@samba.org>
Sun, 23 Sep 2012 06:39:49 +0000 (08:39 +0200)
committerChristian Ambach <ambi@samba.org>
Mon, 24 Sep 2012 00:10:29 +0000 (17:10 -0700)
no point in calling this if printing was disabled and no spoolss service was started
this hurts CTDB clusters as the smbds on the cluster nodes will fight for the single record in the TDB

This fixes Bug 9197 - Disabling printing still makes smbd create and access printer_list.tdb

source3/smbd/server.c

index d53b19a57f30f8ac86ea2d318ff165dd950489af..15762d84e9d4d43088054fe6adac19e744d79e08 100644 (file)
@@ -1529,7 +1529,10 @@ extern void build_options(bool screen);
 
        /* do a printer update now that all messaging has been set up,
         * before we allow clients to start connecting */
-       printing_subsystem_update(ev_ctx, msg_ctx, false);
+       if (!lp__disable_spoolss() &&
+           (rpc_spoolss_daemon() != RPC_DAEMON_DISABLED)) {
+               printing_subsystem_update(ev_ctx, msg_ctx, false);
+       }
 
        TALLOC_FREE(frame);
        /* make sure we always have a valid stackframe */