diff options
author | David Disseldorp <ddiss@samba.org> | 2019-01-29 01:55:04 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2019-02-21 12:31:46 +0100 |
commit | 8c8457150c53045a81207c340cc8694ac60f28bf (patch) | |
tree | 5ac2df96303d8877e7bd9a6ff60b9d491e6fa1c4 /source3 | |
parent | 32d6bf67801e66cf7472788a520c270f454d924d (diff) | |
download | samba-8c8457150c53045a81207c340cc8694ac60f28bf.tar.gz |
printing: check lp_load_printers() prior to pcap cache update
Avoid explicit and housekeeping timer triggered printcap cache updates
if lp_load_printers() is disabled.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13766
Signed-off-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Fri Feb 1 19:25:03 CET 2019 on sn-devel-144
(cherry picked from commit 6a77237c50dd258521f356af0b5dc9942dd5592e)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/printing/pcap.c | 5 | ||||
-rw-r--r-- | source3/printing/queue_process.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c index 726111816d6..d771cd9dfeb 100644 --- a/source3/printing/pcap.c +++ b/source3/printing/pcap.c @@ -139,6 +139,11 @@ void pcap_cache_reload(struct tevent_context *ev, DEBUG(3, ("reloading printcap cache\n")); + if (!lp_load_printers()) { + DBG_NOTICE("skipping reload - load printers disabled\n"); + return; + } + /* only go looking if no printcap name supplied */ if (pcap_name == NULL || *pcap_name == 0) { DEBUG(0, ("No printcap file name configured!\n")); diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c index 4fe6c576a19..ce4e0bcda09 100644 --- a/source3/printing/queue_process.c +++ b/source3/printing/queue_process.c @@ -171,7 +171,7 @@ static bool printing_subsystem_queue_tasks(struct bq_state *state) /* cancel any existing housekeeping event */ TALLOC_FREE(state->housekeep); - if (housekeeping_period == 0) { + if ((housekeeping_period == 0) || !lp_load_printers()) { DEBUG(4, ("background print queue housekeeping disabled\n")); return true; } |