s3: Lift the smbd_messaging_context from reload_services
[abartlet/samba.git/.git] / source3 / smbd / server_reload.c
index 601f83fb15323c49dc6bf72d0ec2012711031d87..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,15 +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, pinfo2,
+                                                  server_info,
+                                                  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);
                }
        }
@@ -85,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;
 
@@ -107,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();