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
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"));
/* 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;
}