diff options
author | Volker Lendecke <vl@samba.org> | 2015-06-15 12:14:43 +0000 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2015-06-15 22:44:56 +0200 |
commit | 69e1f3d6f062a1d6cd014bd2e3f0608e1c86789b (patch) | |
tree | 5cdc68622fcdcf90b7ba9dd04f9f5a92f6536537 /source3/utils/net.c | |
parent | 04c6879b9b3fa9a83d9d55c9088a506385b2f290 (diff) | |
download | samba-69e1f3d6f062a1d6cd014bd2e3f0608e1c86789b.tar.gz |
net: Fix messaging_init for clustering
A full loadparm with include=registry implicitly initializes a
messaging_context. We need to use that.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jun 15 22:44:57 CEST 2015 on sn-devel-104
Diffstat (limited to 'source3/utils/net.c')
-rw-r--r-- | source3/utils/net.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c index ceaf5da939a..4a8fad1ba0d 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -889,7 +889,23 @@ static struct functable net_func[] = { } } - lp_load_global(get_dyn_CONFIGFILE()); + 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); + } + + /* + * Failing to init the msg_ctx isn't a fatal error. Only root-level + * things (joining/leaving domains etc.) will be denied. + */ + c->msg_ctx = messaging_init(c, samba_tevent_context_init(c)); + + if (!lp_load_global(get_dyn_CONFIGFILE())) { + d_fprintf(stderr, "Can't load %s - run testparm to debug it\n", + get_dyn_CONFIGFILE()); + exit(1); + } #if defined(HAVE_BIND_TEXTDOMAIN_CODESET) /* Bind our gettext results to 'unix charset' @@ -953,11 +969,6 @@ static struct functable net_func[] = { popt_burn_cmdline_password(argc, argv); - /* Failing to init the msg_ctx isn't a fatal error. Only - root-level things (joining/leaving domains etc.) will be denied. */ - - c->msg_ctx = messaging_init(c, samba_tevent_context_init(c)); - rc = net_run_function(c, argc_new-1, argv_new+1, "net", net_func); DEBUG(2,("return code = %d\n", rc)); |