summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2018-08-20 15:46:27 -0700
committerKarolin Seeger <kseeger@samba.org>2018-10-09 11:29:23 +0200
commit37d29db0bdb68d4dcf07ba62a39fd8b72e0f169f (patch)
tree26d2984fddc28d261d05822cdf26125f42ca78ba /source3/utils
parent4a89ab6ca40d6be4af879fb999f94b9d8079d480 (diff)
downloadsamba-37d29db0bdb68d4dcf07ba62a39fd8b72e0f169f.tar.gz
s3:smbstatus: Use cmdline_messaging_context
Use cmdline_messaging_context to initialize a messaging context instead of open coding the same steps. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (backported from commit d7fa3815a83a50fd9e3d78cac0d5ef3eb79235e5)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/status.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/source3/utils/status.c b/source3/utils/status.c
index dfb1d921a42..4756b971697 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -48,6 +48,7 @@
#include "serverid.h"
#include "status_profile.h"
#include "smbd/notifyd/notifyd.h"
+#include "cmdline_contexts.h"
#define SMB_MAXPIDS 2048
static uid_t Ucrit_uid = 0; /* added by OH */
@@ -605,21 +606,9 @@ int main(int argc, const char *argv[])
d_printf("using configfile = %s\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;
- }
-
-
- /*
- * This implicitly initializes the global ctdbd connection,
- * usable by the db_open() calls further down.
- */
- msg_ctx = messaging_init(NULL, samba_tevent_context_init(NULL));
+ msg_ctx = cmdline_messaging_context(get_dyn_CONFIGFILE());
if (msg_ctx == NULL) {
- fprintf(stderr, "messaging_init failed\n");
+ fprintf(stderr, "Could not initialize messaging, not root?\n");
ret = -1;
goto done;
}