s4:winbindd Return the wbsrv_service structure to help s3compat
authorAndrew Bartlett <abartlet@samba.org>
Mon, 17 May 2010 09:54:45 +0000 (19:54 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 3 Jun 2010 01:14:10 +0000 (11:14 +1000)
This allows it to be stashed in a static variable if required.

Andrew Bartlett

source4/winbind/wb_server.c

index ae42563af4c0774d5f7cc86b24915c2a57079dd4..345fa4a1a301f494332532f3972fd8a9a8c0a88c 100644 (file)
@@ -198,7 +198,7 @@ static const struct stream_server_ops wbsrv_ops = {
 /*
   startup the winbind task
 */
-void winbind_prepare_task(struct task_server *task, const struct model_ops *model_ops)
+struct wbsrv_service *winbind_prepare_task(struct task_server *task, const struct model_ops *model_ops)
 {
        uint16_t port = 1;
        NTSTATUS status;
@@ -211,14 +211,14 @@ void winbind_prepare_task(struct task_server *task, const struct model_ops *mode
        if (!directory_create_or_exist(lp_winbindd_socket_directory(task->lp_ctx), geteuid(), 0755)) {
                task_server_terminate(task,
                                      "Cannot create winbindd pipe directory", true);
-               return;
+               return NULL;
        }
 
        /* Make sure the directory for the Samba3 socket exists, and is of the correct permissions */
        if (!directory_create_or_exist(lp_winbindd_privileged_socket_directory(task->lp_ctx), geteuid(), 0750)) {
                task_server_terminate(task,
                                      "Cannot create winbindd privileged pipe directory", true);
-               return;
+               return NULL;
        }
 
        service = talloc_zero(task, struct wbsrv_service);
@@ -241,7 +241,7 @@ void winbind_prepare_task(struct task_server *task, const struct model_ops *mode
                                                        "Have you provisioned this server (%s) or changed it's name?", 
                                                        errstring, lp_netbios_name(service->task->lp_ctx));
                        task_server_terminate(task, message, true);
-                       return;
+                       return NULL;
                }
                break;
        case ROLE_DOMAIN_MEMBER:
@@ -254,7 +254,7 @@ void winbind_prepare_task(struct task_server *task, const struct model_ops *mode
                                                        "Have you joined the %s domain?", 
                                                        errstring, lp_workgroup(service->task->lp_ctx));
                        task_server_terminate(task, message, true);
-                       return;
+                       return NULL;
                }
                break;
        case ROLE_DOMAIN_CONTROLLER:
@@ -267,7 +267,7 @@ void winbind_prepare_task(struct task_server *task, const struct model_ops *mode
                                                        "Have you provisioned the %s domain?", 
                                                        errstring, lp_workgroup(service->task->lp_ctx));
                        task_server_terminate(task, message, true);
-                       return;
+                       return NULL;
                }
                break;
        }
@@ -276,7 +276,7 @@ void winbind_prepare_task(struct task_server *task, const struct model_ops *mode
        service->idmap_ctx = idmap_init(service, task->event_ctx, task->lp_ctx);
        if (service->idmap_ctx == NULL) {
                task_server_terminate(task, "Failed to load idmap database", true);
-               return;
+               return NULL;
        }
 
        service->priv_pipe_dir = lp_winbindd_privileged_socket_directory(task->lp_ctx);
@@ -318,21 +318,21 @@ void winbind_prepare_task(struct task_server *task, const struct model_ops *mode
        status = wbsrv_init_irpc(service);
        if (!NT_STATUS_IS_OK(status)) goto irpc_failed;
 
-       return;
+       return service;
 
 listen_failed:
        DEBUG(0,("stream_setup_socket(path=%s) failed - %s\n",
                 listen_socket->socket_path, nt_errstr(status)));
        task_server_terminate(task, nt_errstr(status), true);
-       return;
+       return NULL;
 irpc_failed:
        DEBUG(0,("wbsrv_init_irpc() failed - %s\n",
                 nt_errstr(status)));
        task_server_terminate(task, nt_errstr(status), true);
-       return;
+       return NULL;
 nomem:
        task_server_terminate(task, nt_errstr(NT_STATUS_NO_MEMORY), true);
-       return;
+       return NULL;
 }
 
 /*