s3-smbd: Pass tevent context to messaging functions.
authorAndreas Schneider <asn@samba.org>
Mon, 28 Feb 2011 13:32:54 +0000 (14:32 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 28 Feb 2011 18:00:08 +0000 (19:00 +0100)
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Feb 28 19:00:08 CET 2011 on sn-devel-104

source3/smbd/server.c

index dd715e993ad34f6253ef0d7bd23f2984d9d349c7..b1553028f4285fc09a7edd3d25bd046419c44987 100644 (file)
@@ -84,12 +84,15 @@ static void smb_conf_updated(struct messaging_context *msg,
                             struct server_id server_id,
                             DATA_BLOB *data)
 {
+       struct tevent_context *ev_ctx =
+               talloc_get_type_abort(private_data, struct tevent_context);
+
        DEBUG(10,("smb_conf_updated: Got message saying smb.conf was "
                  "updated. Reloading.\n"));
        change_to_root_user();
        reload_services(msg, smbd_server_conn->sock, False);
        if (am_parent) {
-               pcap_cache_reload(server_event_context(), msg,
+               pcap_cache_reload(ev_ctx, msg,
                                  &reload_pcap_change_notify);
        }
 }
@@ -104,9 +107,12 @@ static void smb_pcap_updated(struct messaging_context *msg,
                             struct server_id server_id,
                             DATA_BLOB *data)
 {
+       struct tevent_context *ev_ctx =
+               talloc_get_type_abort(private_data, struct tevent_context);
+
        DEBUG(10,("Got message saying pcap was updated. Reloading.\n"));
        change_to_root_user();
-       reload_printers(server_event_context(), msg);
+       reload_printers(ev_ctx, msg);
 }
 
 /*******************************************************************
@@ -752,12 +758,13 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
        messaging_register(msg_ctx, NULL, MSG_SHUTDOWN, msg_exit_server);
        messaging_register(msg_ctx, NULL, MSG_SMB_FILE_RENAME,
                           msg_file_was_renamed);
-       messaging_register(msg_ctx, NULL, MSG_SMB_CONF_UPDATED,
+       messaging_register(msg_ctx, server_event_context(), MSG_SMB_CONF_UPDATED,
                           smb_conf_updated);
        messaging_register(msg_ctx, NULL, MSG_SMB_STAT_CACHE_DELETE,
                           smb_stat_cache_delete);
        messaging_register(msg_ctx, NULL, MSG_DEBUG, smbd_msg_debug);
-       messaging_register(msg_ctx, NULL, MSG_PRINTER_PCAP, smb_pcap_updated);
+       messaging_register(msg_ctx, server_event_context(), MSG_PRINTER_PCAP,
+                          smb_pcap_updated);
        brl_register_msgs(msg_ctx);
 
        msg_idmap_register_msgs(msg_ctx);