/* Send SIGHUP to process group... is there a better way? */
kill(0, SIGHUP);
- if ( ( i = lp_servicenumber( Printer->dev.handlename ) ) >= 0 ) {
- lp_killservice( i );
- return WERR_OK;
- } else
+ /* go ahead and re-read the services immediately */
+ reload_services( False );
+
+ if ( ( i = lp_servicenumber( Printer->dev.handlename ) ) < 0 )
return WERR_ACCESS_DENIED;
}
/* Send SIGHUP to process group... is there a better way? */
kill(0, SIGHUP);
- add_all_printers();
+
+ /* reload our services immediately */
+ reload_services( False );
}
file_lines_free(qlines);
result = WERR_NOMEM;
goto done;
}
+
+ /*
+ * make sure we actually reload the services after
+ * this as smb.conf could have a new section in it
+ * .... shouldn't .... but could
+ */
+ reload_services(False);
}
/* Do sanity check on the requested changes for Samba */
return WERR_PRINTER_ALREADY_EXISTS;
}
- if (*lp_addprinter_cmd() )
+ if (*lp_addprinter_cmd() ) {
if ( !add_printer_hook(printer) ) {
free_a_printer(&printer,2);
return WERR_ACCESS_DENIED;
}
+ }
slprintf(name, sizeof(name)-1, "\\\\%s\\%s", get_called_name(),
printer->info_2->sharename);
+
if ((snum = print_queue_snum(printer->info_2->sharename)) == -1) {
free_a_printer(&printer,2);
return WERR_ACCESS_DENIED;