s4: allways initialize the process model before it's used
authorStefan Metzmacher <metze@samba.org>
Mon, 22 Sep 2008 16:15:24 +0000 (18:15 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 22 Sep 2008 16:16:09 +0000 (18:16 +0200)
metze

source4/kdc/kdc.c
source4/ldap_server/ldap_server.c
source4/ntp_signd/ntp_signd.c
source4/smbd/process_model.c
source4/smbd/process_model.h
source4/web_server/web_server.c
source4/winbind/wb_server.c
source4/wrepl_server/wrepl_in_connection.c

index b7009b030f1678b73c15e910e10fb50ea3a9a098..307c39a43c7d80567f1a815614ba96903804467f 100644 (file)
@@ -484,7 +484,7 @@ static NTSTATUS kdc_add_socket(struct kdc_server *kdc, const char *address,
        /* within the kdc task we want to be a single process, so
           ask for the single process model ops and pass these to the
           stream_setup_socket() call. */
-       model_ops = process_model_byname("single");
+       model_ops = process_model_startup(kdc->task->event_ctx, "single");
        if (!model_ops) {
                DEBUG(0,("Can't find 'single' process model_ops\n"));
                talloc_free(kdc_socket);
index 39a55f4420d1b1bf6579026f2ca663494e212f75..57a63a851606e1e10c38de4f370dee57848b6529 100644 (file)
@@ -529,7 +529,7 @@ static void ldapsrv_task_init(struct task_server *task)
        task_server_set_title(task, "task[ldapsrv]");
 
        /* run the ldap server as a single process */
-       model_ops = process_model_byname("single");
+       model_ops = process_model_startup(task->event_ctx, "single");
        if (!model_ops) goto failed;
 
        ldap_service = talloc_zero(task, struct ldapsrv_service);
index 546743e4e64e347cef8e6a2f4633151e809af1af..8bcf258e5ed4edf1b87dd32ef4cfa92fbbda589c 100644 (file)
@@ -349,7 +349,7 @@ static void ntp_signd_task_init(struct task_server *task)
        /* within the ntp_signd task we want to be a single process, so
           ask for the single process model ops and pass these to the
           stream_setup_socket() call. */
-       model_ops = process_model_byname("single");
+       model_ops = process_model_startup(task->event_ctx, "single");
        if (!model_ops) {
                DEBUG(0,("Can't find 'single' process model_ops\n"));
                return;
index 704e6cc7a2f19401c4cf42e7c4efe9c57fa944ed..d99d517d9f290961d2b8581956324bec0c0edc05 100644 (file)
@@ -22,6 +22,8 @@
 #include "smbd/process_model.h"
 #include "param/param.h"
 
+static const struct model_ops *process_model_byname(const char *name);
+
 /*
   setup the events for the chosen process model
 */
@@ -99,7 +101,7 @@ _PUBLIC_ NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
 /*
   return the operations structure for a named backend of the specified type
 */
-_PUBLIC_ const struct model_ops *process_model_byname(const char *name)
+static const struct model_ops *process_model_byname(const char *name)
 {
        int i;
 
index b545212091ad90ddd117d3c03784628eac81223e..a9b33a4725017fdbc36588677108c08312e8070b 100644 (file)
@@ -78,7 +78,6 @@ struct process_model_critical_sizes {
 extern const struct model_ops single_ops;
 
 const struct model_ops *process_model_startup(struct event_context *ev, const char *model);
-const struct model_ops *process_model_byname(const char *name);
 NTSTATUS register_process_model(const void *_ops);
 NTSTATUS process_model_init(struct loadparm_context *lp_ctx);
 
index 1ed37f657b2a37aea530d730ccea2f88a6516e27..d74199277091f09027d5a696020de43d38bd40f3 100644 (file)
@@ -307,7 +307,7 @@ static void websrv_task_init(struct task_server *task)
        task_server_set_title(task, "task[websrv]");
 
        /* run the web server as a single process */
-       model_ops = process_model_byname("single");
+       model_ops = process_model_startup(task->event_ctx, "single");
        if (!model_ops) goto failed;
 
        if (lp_interfaces(task->lp_ctx) && lp_bind_interfaces_only(task->lp_ctx)) {
index d56a82ea18d872f7b609bc70e0385898e2bfba09..638fac00a16a6b698374b58b8ed1863f45f2c4ad 100644 (file)
@@ -122,7 +122,7 @@ static void winbind_task_init(struct task_server *task)
        /* within the winbind task we want to be a single process, so
           ask for the single process model ops and pass these to the
           stream_setup_socket() call. */
-       model_ops = process_model_byname("single");
+       model_ops = process_model_startup(task->event_ctx, "single");
        if (!model_ops) {
                task_server_terminate(task,
                                      "Can't find 'single' process model_ops");
index 25227481b8820aa07ddf0ae459f168bcc35c6c60..ecc265e590abcb4e922ab24565a4a66a2b62db6f 100644 (file)
@@ -218,7 +218,7 @@ NTSTATUS wreplsrv_in_connection_merge(struct wreplsrv_partner *partner,
        /* within the wrepl task we want to be a single process, so
           ask for the single process model ops and pass these to the
           stream_setup_socket() call. */
-       model_ops = process_model_byname("single");
+       model_ops = process_model_startup(service->task->event_ctx, "single");
        if (!model_ops) {
                DEBUG(0,("Can't find 'single' process model_ops"));
                return NT_STATUS_INTERNAL_ERROR;
@@ -273,7 +273,7 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar
        /* within the wrepl task we want to be a single process, so
           ask for the single process model ops and pass these to the
           stream_setup_socket() call. */
-       model_ops = process_model_byname("single");
+       model_ops = process_model_startup(task->event_ctx, "single");
        if (!model_ops) {
                DEBUG(0,("Can't find 'single' process model_ops"));
                return NT_STATUS_INTERNAL_ERROR;