}
sname = lp_const_servicename(snum);
- pname = lp_printername(snum);
+ pname = lp_printername(session_info, snum);
/* check printer, but avoid removing non-autoloaded printers */
- if (!pcap_printername_ok(pname) && lp_autoloaded(snum)) {
+ if (lp_autoloaded(snum) && !pcap_printername_ok(pname)) {
DEBUG(3, ("removing stale printer %s\n", pname));
if (is_printer_published(session_info, session_info,
msg_ctx,
- NULL, lp_servicename(snum),
- NULL, &pinfo2)) {
+ NULL,
+ lp_servicename(session_info,
+ snum),
+ &pinfo2)) {
nt_printer_publish(session_info,
session_info,
msg_ctx,
bool ret;
if (lp_loaded()) {
- char *fname = lp_configfile();
+ char *fname = lp_configfile(talloc_tos());
if (file_exist(fname) &&
!strcsequal(fname, get_dyn_CONFIGFILE())) {
set_dyn_CONFIGFILE(fname);
test = False;
}
+ TALLOC_FREE(fname);
}
reopen_logs();
lp_killunused(sconn, snumused);
- ret = lp_load(get_dyn_CONFIGFILE(), False, False, True, True);
+ ret = lp_load(get_dyn_CONFIGFILE(),
+ false, /* global only */
+ false, /* save defaults */
+ true, /* add_ipc */
+ true); /* initialize globals */
/* perhaps the config filename is now set */
if (!test) {