summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/smbd/process_model.c16
-rw-r--r--source4/torture/rpc/spoolss_notify.c4
2 files changed, 15 insertions, 5 deletions
diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c
index 0e63605460..3d5e2ce229 100644
--- a/source4/smbd/process_model.c
+++ b/source4/smbd/process_model.c
@@ -108,13 +108,19 @@ _PUBLIC_ NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
extern NTSTATUS process_model_prefork_init(void);
extern NTSTATUS process_model_onefork_init(void);
extern NTSTATUS process_model_single_init(void);
- init_module_fn static_init[] = { STATIC_process_model_MODULES };
- init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "process_model");
+ static bool initialised;
- run_init_functions(static_init);
- run_init_functions(shared_init);
+ if (!initialised) {
+ init_module_fn static_init[] = { STATIC_process_model_MODULES };
+ init_module_fn *shared_init;
+ initialised = true;
+ shared_init = load_samba_modules(NULL, lp_ctx, "process_model");
- talloc_free(shared_init);
+ run_init_functions(static_init);
+ run_init_functions(shared_init);
+
+ talloc_free(shared_init);
+ }
return NT_STATUS_OK;
}
diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c
index 4608f1f09d..facfd3e52a 100644
--- a/source4/torture/rpc/spoolss_notify.c
+++ b/source4/torture/rpc/spoolss_notify.c
@@ -460,6 +460,10 @@ static bool test_start_dcerpc_server(struct torture_context *tctx,
torture_comment(tctx, "Listening for callbacks on %s\n", address);
+ status = process_model_init(tctx->lp_ctx);
+ torture_assert_ntstatus_ok(tctx, status,
+ "unable to initialize process models");
+
status = smbsrv_add_socket(event_ctx, tctx->lp_ctx, process_model_startup("single"), address);
torture_assert_ntstatus_ok(tctx, status, "starting smb server");