s3: Lift the smbd_messaging_context from reload_services
[abartlet/samba.git/.git] / source3 / smbd / server_reload.c
index 220147da602d037bf713f35e3dc70468fd8df0ec..80e30c04b61afdf4d95c9a0ec98b4b532fb0068b 100644 (file)
@@ -29,7 +29,7 @@
 /****************************************************************************
  Reload printers
 **************************************************************************/
-void reload_printers(void)
+void reload_printers(struct messaging_context *msg_ctx)
 {
        struct auth_serversupplied_info *server_info = NULL;
        struct spoolss_PrinterInfo2 *pinfo2 = NULL;
@@ -63,17 +63,18 @@ void reload_printers(void)
                        DEBUG(3, ("removing stale printer %s\n", pname));
 
                        if (is_printer_published(server_info, server_info,
+                                                msg_ctx,
                                                 NULL, lp_servicename(snum),
                                                 NULL, &pinfo2)) {
                                nt_printer_publish(server_info,
                                                   server_info,
-                                                  smbd_messaging_context(),
+                                                  msg_ctx,
                                                   pinfo2,
                                                   DSPRINT_UNPUBLISH);
                                TALLOC_FREE(pinfo2);
                        }
-                       nt_printer_remove(server_info, server_info,
-                                         smbd_messaging_context(), pname);
+                       nt_printer_remove(server_info, server_info, msg_ctx,
+                                         pname);
                        lp_killservice(snum);
                }
        }
@@ -87,7 +88,7 @@ void reload_printers(void)
  Reload the services file.
 **************************************************************************/
 
-bool reload_services(bool test)
+bool reload_services(struct messaging_context *msg_ctx, bool test)
 {
        bool ret;
 
@@ -109,11 +110,11 @@ bool reload_services(bool test)
 
        ret = lp_load(get_dyn_CONFIGFILE(), False, False, True, True);
 
-       reload_printers();
+       reload_printers(msg_ctx);
 
        /* perhaps the config filename is now set */
        if (!test)
-               reload_services(True);
+               reload_services(msg_ctx, True);
 
        reopen_logs();