]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:printing: Load the shares for [printers] in samba-bgqd
authorAndreas Schneider <asn@samba.org>
Thu, 23 Oct 2025 08:49:31 +0000 (10:49 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 14 Nov 2025 14:00:31 +0000 (14:00 +0000)
One of the main functions of bgqd is:

        delete_and_reload_printers_full()

It isn't able to do its work, if we don't load the shares. Normally bgqd was
forked from smbd and this loaded the shares. But with the introduction of
samba-dcerpcd it is a standalone service now. As a standalone service it is
responsible to load the shares if it needs to work on them.

The following message is printed if delete_and_reload_printers_full() tries to
do its job:

[2025/10/23 09:57:27,  7, pid=41935, effective(0, 0), real(0, 0)] ../../source3/param/loadparm.c:4419(lp_servicenumber)
  lp_servicenumber: couldn't find printers
[2025/10/23 09:57:27,  7, pid=41935, effective(0, 0), real(0, 0)] ../../source3/param/loadparm.c:4419(lp_servicenumber)
  lp_servicenumber: couldn't find printers

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15936

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/printing/queue_process.c

index 0f95bd736f2a794d68922488998a73c59ccf64ee..51eafa31572a49485b8ad55657a8a3503f6fd31a 100644 (file)
@@ -265,6 +265,7 @@ static void bq_smb_conf_updated(struct messaging_context *msg_ctx,
        DEBUG(10,("smb_conf_updated: Got message saying smb.conf was "
                  "updated. Reloading.\n"));
        change_to_root_user();
+       lp_load_with_shares(get_dyn_CONFIGFILE());
        pcap_cache_reload(state->ev, msg_ctx, reload_pcap_change_notify);
        printing_subsystem_queue_tasks(state);
 }
@@ -322,6 +323,8 @@ struct bq_state *register_printing_bq_handlers(
                goto fail_free_handlers;
        }
 
+       /* Load shares, needed for [printers] */
+       lp_load_with_shares(get_dyn_CONFIGFILE());
        /* Initialize the printcap cache as soon as the daemon starts. */
        pcap_cache_reload(state->ev, state->msg, reload_pcap_change_notify);