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/smb_server/service_smb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/smb_server/service_smb.c') diff --git a/source4/smb_server/service_smb.c b/source4/smb_server/service_smb.c index 54feccbe05..583360bbe7 100644 --- a/source4/smb_server/service_smb.c +++ b/source4/smb_server/service_smb.c @@ -58,12 +58,12 @@ static void smbsrv_task_init(struct task_server *task) */ for(i = 0; i < num_interfaces; i++) { const char *address = iface_n_ip(ifaces, i); - status = smbsrv_add_socket(task->event_ctx, task->lp_ctx, task->model_ops, address); + status = smbsrv_add_socket(task, task->event_ctx, task->lp_ctx, task->model_ops, address); if (!NT_STATUS_IS_OK(status)) goto failed; } } else { /* Just bind to lpcfg_socket_address() (usually 0.0.0.0) */ - status = smbsrv_add_socket(task->event_ctx, task->lp_ctx, task->model_ops, + status = smbsrv_add_socket(task, task->event_ctx, task->lp_ctx, task->model_ops, lpcfg_socket_address(task->lp_ctx)); if (!NT_STATUS_IS_OK(status)) goto failed; } -- cgit