source4/smbd: Do not overstamp the process model with "single"
[kai/samba-autobuild/.git] / source4 / wrepl_server / wrepl_in_connection.c
index 4920aa0328fe2990e7001a205140474ac996334d..5cbb086a8db3bf61c76d6af9645d24d256ff6fca 100644 (file)
@@ -352,20 +352,10 @@ NTSTATUS wreplsrv_in_connection_merge(struct wreplsrv_partner *partner,
 {
        struct wreplsrv_service *service = partner->service;
        struct wreplsrv_in_connection *wrepl_in;
-       const struct model_ops *model_ops;
        struct stream_connection *conn;
        struct tevent_req *subreq;
        NTSTATUS status;
 
-       /* 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_startup("single");
-       if (!model_ops) {
-               DEBUG(0,("Can't find 'single' process model_ops"));
-               return NT_STATUS_INTERNAL_ERROR;
-       }
-
        wrepl_in = talloc_zero(partner, struct wreplsrv_in_connection);
        NT_STATUS_HAVE_NO_MEMORY(wrepl_in);
 
@@ -376,7 +366,7 @@ NTSTATUS wreplsrv_in_connection_merge(struct wreplsrv_partner *partner,
 
        status = stream_new_connection_merge(service->task->event_ctx,
                                             service->task->lp_ctx,
-                                            model_ops,
+                                            service->task->model_ops,
                                             &wreplsrv_stream_ops,
                                             service->task->msg_ctx,
                                             wrepl_in,
@@ -427,19 +417,9 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar
 {
        NTSTATUS status;
        struct task_server *task = service->task;
-       const struct model_ops *model_ops;
        const char *address;
        uint16_t port = WINS_REPLICATION_PORT;
 
-       /* 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_startup("single");
-       if (!model_ops) {
-               DEBUG(0,("Can't find 'single' process model_ops"));
-               return NT_STATUS_INTERNAL_ERROR;
-       }
-
        if (lpcfg_interfaces(lp_ctx) && lpcfg_bind_interfaces_only(lp_ctx)) {
                int num_interfaces;
                int i;
@@ -458,12 +438,14 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar
                                continue;
                        }
                        address = iface_list_n_ip(ifaces, i);
-                       status = stream_setup_socket(task, task->event_ctx,
-                                                    task->lp_ctx, model_ops,
-                                                    &wreplsrv_stream_ops,
-                                                    "ipv4", address, &port, 
-                                                     lpcfg_socket_options(task->lp_ctx),
-                                                    service, task->process_context);
+                       status = stream_setup_socket(
+                                       task, task->event_ctx,
+                                       task->lp_ctx,
+                                       task->model_ops,
+                                       &wreplsrv_stream_ops,
+                                       "ipv4", address, &port,
+                                       lpcfg_socket_options(task->lp_ctx),
+                                       service, task->process_context);
                        if (!NT_STATUS_IS_OK(status)) {
                                DEBUG(0,("stream_setup_socket(address=%s,port=%u) failed - %s\n",
                                         address, port, nt_errstr(status)));
@@ -472,9 +454,11 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar
                }
        } else {
                address = "0.0.0.0";
-               status = stream_setup_socket(task, task->event_ctx, task->lp_ctx,
-                                            model_ops, &wreplsrv_stream_ops,
-                                            "ipv4", address, &port, lpcfg_socket_options(task->lp_ctx),
+               status = stream_setup_socket(task, task->event_ctx,
+                                            task->lp_ctx, task->model_ops,
+                                            &wreplsrv_stream_ops,
+                                            "ipv4", address, &port,
+                                            lpcfg_socket_options(task->lp_ctx),
                                             service, task->process_context);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0,("stream_setup_socket(address=%s,port=%u) failed - %s\n",