summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-22 14:55:32 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-22 08:09:06 +0200
commit2d21fe079fb57e55d9bac0c69d8527013bf4fbc7 (patch)
tree87c39ddaa23e90578b9408f31b87b093c1e7cb17 /source4/smbd
parentfafd386910ca5f17c42cd0cf0a7c759f0950d518 (diff)
downloadsamba-2d21fe079fb57e55d9bac0c69d8527013bf4fbc7.tar.gz
samba-2d21fe079fb57e55d9bac0c69d8527013bf4fbc7.tar.bz2
samba-2d21fe079fb57e55d9bac0c69d8527013bf4fbc7.zip
s4-messaging: fixed the removal of messaging sockets in child tasks
when a child task exits we were firing a destructor on any inherited messaging contexts, which could trigger a removal of the parents message socket and messaging database entry. This adds a new auto_remove flag to imessaging_init(), and exposes the cleanup code for use by the stream service. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Fri Jul 22 08:09:06 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/server.c4
-rw-r--r--source4/smbd/service_stream.c5
-rw-r--r--source4/smbd/service_task.c6
3 files changed, 8 insertions, 7 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index b0f683ba93..ba8f8227a9 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -220,8 +220,8 @@ static NTSTATUS setup_parent_messaging(struct tevent_context *event_ctx,
NTSTATUS status;
msg = imessaging_init(talloc_autofree_context(),
- lpcfg_imessaging_path(event_ctx, lp_ctx),
- cluster_id(0, SAMBA_PARENT_TASKID), event_ctx);
+ lpcfg_imessaging_path(event_ctx, lp_ctx),
+ cluster_id(0, SAMBA_PARENT_TASKID), event_ctx, false);
NT_STATUS_HAVE_NO_MEMORY(msg);
irpc_add_name(msg, "samba");
diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c
index 6e65122063..28159f4f00 100644
--- a/source4/smbd/service_stream.c
+++ b/source4/smbd/service_stream.c
@@ -77,6 +77,7 @@ void stream_terminate_connection(struct stream_connection *srv_conn, const char
talloc_free(srv_conn->event.fde);
srv_conn->event.fde = NULL;
+ imessaging_cleanup(srv_conn->msg_ctx);
model_ops->terminate(event_ctx, srv_conn->lp_ctx, reason);
talloc_free(srv_conn);
}
@@ -188,8 +189,8 @@ static void stream_new_connection(struct tevent_context *ev,
/* setup to receive internal messages on this connection */
srv_conn->msg_ctx = imessaging_init(srv_conn,
- lpcfg_imessaging_path(srv_conn, lp_ctx),
- srv_conn->server_id, ev);
+ lpcfg_imessaging_path(srv_conn, lp_ctx),
+ srv_conn->server_id, ev, false);
if (!srv_conn->msg_ctx) {
stream_terminate_connection(srv_conn, "imessaging_init() failed");
return;
diff --git a/source4/smbd/service_task.c b/source4/smbd/service_task.c
index 32c44cf660..f68805fde0 100644
--- a/source4/smbd/service_task.c
+++ b/source4/smbd/service_task.c
@@ -79,9 +79,9 @@ static void task_server_callback(struct tevent_context *event_ctx,
task->lp_ctx = lp_ctx;
task->msg_ctx = imessaging_init(task,
- lpcfg_imessaging_path(task, task->lp_ctx),
- task->server_id,
- task->event_ctx);
+ lpcfg_imessaging_path(task, task->lp_ctx),
+ task->server_id,
+ task->event_ctx, false);
if (!task->msg_ctx) {
task_server_terminate(task, "imessaging_init() failed", true);
return;