#include "../libcli/security/security.h"
#include "passdb.h"
#include "messages.h"
+#include "cmdline_contexts.h"
#ifdef WITH_FAKE_KASERVER
#include "utils/net_afs.h"
const char **argv_const = discard_const_p(const char *, argv);
poptContext pc;
TALLOC_CTX *frame = talloc_stackframe();
- struct tevent_context *ev;
struct net_context *c = talloc_zero(frame, struct net_context);
- NTSTATUS status;
struct poptOption long_options[] = {
{"help", 'h', POPT_ARG_NONE, 0, 'h'},
}
}
- if (!lp_load_initial_only(get_dyn_CONFIGFILE())) {
- d_fprintf(stderr, "Can't load %s - run testparm to debug it\n",
- get_dyn_CONFIGFILE());
- exit(1);
- }
-
- ev = samba_tevent_context_init(c);
- if (ev == NULL) {
- d_fprintf(stderr, "samba_tevent_context_init failed\n");
- exit(1);
- }
- status = messaging_init_client(c, ev, &c->msg_ctx);
- if (geteuid() != 0 &&
- NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
- /*
- * Normal to fail to initialize messaging context
- * if we're not root as we don't have ability to
- * read lock directory.
- */
- DBG_NOTICE("Unable to initialize messaging context. "
- "Must be root to do that.\n");
- } else if (!NT_STATUS_IS_OK(status)) {
- d_fprintf(stderr, "Failed to init messaging context\n");
- exit(1);
- }
+ c->msg_ctx = cmdline_messaging_context(get_dyn_CONFIGFILE());
if (!lp_load_global(get_dyn_CONFIGFILE())) {
d_fprintf(stderr, "Can't load %s - run testparm to debug it\n",