summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-10-30 23:42:27 +1100
committerAndrew Tridgell <tridge@samba.org>2010-10-30 13:32:09 +0000
commitb4ba669e48f7dd213d530a24f4587dea93c84223 (patch)
treee98e79947df9cd03d6b5867e9bc969bed146200e /source4
parent35d466e66b464cefca2e33fa8e1ff7301b029690 (diff)
downloadsamba-b4ba669e48f7dd213d530a24f4587dea93c84223.tar.gz
samba-b4ba669e48f7dd213d530a24f4587dea93c84223.tar.bz2
samba-b4ba669e48f7dd213d530a24f4587dea93c84223.zip
s4-smbd: initialise process models in smbtorture before use
the spoolss notify test needs to setup the process models before use Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Sat Oct 30 13:32:09 UTC 2010 on sn-devel-104
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");