summaryrefslogtreecommitdiff
path: root/source3/smbd/process.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-12-14 12:39:36 +0100
committerStefan Metzmacher <metze@samba.org>2011-12-15 11:03:00 +0100
commite412b8bfcce46720b913d42ac7f56d4e024162f0 (patch)
tree0b27b1d1b246117aa8bbbe6af5bc2c8dc6574157 /source3/smbd/process.c
parent715933a3d3d1023df0d77c1765850e8579b84dfc (diff)
downloadsamba-e412b8bfcce46720b913d42ac7f56d4e024162f0.tar.gz
samba-e412b8bfcce46720b913d42ac7f56d4e024162f0.tar.bz2
samba-e412b8bfcce46720b913d42ac7f56d4e024162f0.zip
s3:smbd: split smb_conf_updated into parent and child versions
metze
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r--source3/smbd/process.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index e57faf1978..2b35680949 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -925,6 +925,22 @@ void smbd_setup_sig_hup_handler(struct smbd_server_connection *sconn)
}
}
+static void smbd_conf_updated(struct messaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ DATA_BLOB *data)
+{
+ struct smbd_server_connection *sconn =
+ talloc_get_type_abort(private_data,
+ struct smbd_server_connection);
+
+ DEBUG(10,("smbd_conf_updated: Got message saying smb.conf was "
+ "updated. Reloading.\n"));
+ change_to_root_user();
+ reload_services(sconn->msg_ctx, sconn->sock, False);
+}
+
static NTSTATUS smbd_server_connection_loop_once(struct tevent_context *ev_ctx,
struct smbd_server_connection *conn)
{
@@ -3254,6 +3270,11 @@ void smbd_process(struct tevent_context *ev_ctx,
messaging_register(sconn->msg_ctx, sconn,
ID_CACHE_KILL, smbd_id_cache_kill);
+ messaging_deregister(sconn->msg_ctx,
+ MSG_SMB_CONF_UPDATED, sconn->ev_ctx);
+ messaging_register(sconn->msg_ctx, sconn,
+ MSG_SMB_CONF_UPDATED, smbd_conf_updated);
+
/*
* Use the default MSG_DEBUG handler to avoid rebroadcasting
* MSGs to all child processes