From ef7f4a142068757dcf0dc11c5b7cf03755be45a8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Nov 2010 10:12:22 +1100 Subject: s4-server: make server sockets a child of the task context We previously allocated sockets as direct children of the event context. That led to crashes if a service called task_server_terminate(), as it left the socket open and handling events for a dead protocol. Making them a child of the task allows the task to terminate and take all its sockets with it. Pair-Programmed-With: Andrew Bartlett --- source4/winbind/wb_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/winbind/wb_server.c') diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c index 34d145d318..5390dab2f7 100644 --- a/source4/winbind/wb_server.c +++ b/source4/winbind/wb_server.c @@ -299,7 +299,7 @@ static void winbind_task_init(struct task_server *task) if (!listen_socket->socket_path) goto nomem; listen_socket->service = service; listen_socket->privileged = false; - status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops, + status = stream_setup_socket(task, task->event_ctx, task->lp_ctx, model_ops, &wbsrv_ops, "unix", listen_socket->socket_path, &port, lpcfg_socket_options(task->lp_ctx), @@ -316,7 +316,7 @@ static void winbind_task_init(struct task_server *task) if (!listen_socket->socket_path) goto nomem; listen_socket->service = service; listen_socket->privileged = true; - status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops, + status = stream_setup_socket(task, task->event_ctx, task->lp_ctx, model_ops, &wbsrv_ops, "unix", listen_socket->socket_path, &port, lpcfg_socket_options(task->lp_ctx), -- cgit