From c02fd606e3623440d8720e627dd58dca75c0fa88 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 23 Apr 2008 11:35:51 +0200 Subject: Correctly initialize lp_load in smbstatus in the presence of registry on tdb2 (This used to be commit c4f7bee9238db536a7d5215cebb0bf37f757dfad) --- source3/utils/status.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'source3/utils/status.c') diff --git a/source3/utils/status.c b/source3/utils/status.c index ffa3fbd17f9..e4592dd8500 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -296,6 +296,7 @@ static int traverse_sessionid(struct db_record *db, void *state) }; TALLOC_CTX *frame = talloc_stackframe(); int ret = 0; + struct messaging_context *msg_ctx; sec_init(); load_case_tables(); @@ -359,8 +360,9 @@ static int traverse_sessionid(struct db_record *db, void *state) d_printf("using configfile = %s\n", get_dyn_CONFIGFILE()); } - if (!lp_load(get_dyn_CONFIGFILE(),False,False,False,True)) { - fprintf(stderr, "Can't load %s - run testparm to debug it\n", get_dyn_CONFIGFILE()); + if (!lp_load_initial_only(get_dyn_CONFIGFILE())) { + fprintf(stderr, "Can't load %s - run testparm to debug it\n", + get_dyn_CONFIGFILE()); ret = -1; goto done; } @@ -370,8 +372,18 @@ static int traverse_sessionid(struct db_record *db, void *state) * the db_open() calls further down. */ - messaging_init(NULL, procid_self(), event_context_init(NULL)); - + msg_ctx = messaging_init(NULL, procid_self(), + event_context_init(NULL)); + + db_tdb2_setup_messaging(msg_ctx, true); + + if (!lp_load(get_dyn_CONFIGFILE(),False,False,False,True)) { + fprintf(stderr, "Can't load %s - run testparm to debug it\n", + get_dyn_CONFIGFILE()); + ret = -1; + goto done; + } + switch (profile_only) { case 'P': /* Dump profile data */ -- cgit