summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-07-10 15:26:40 +0200
committerKarolin Seeger <kseeger@samba.org>2018-10-10 15:51:53 +0200
commit9329a288185162c237f65f8dcaa72e6d52a142c3 (patch)
tree1cc3ef3aadebe2a27e6dfee354fceba02c594a38 /source3/lib
parentbbdefe855af17e8cbbeb473baf939d2b415e8e09 (diff)
downloadsamba-9329a288185162c237f65f8dcaa72e6d52a142c3.tar.gz
s3:popt_common: use cmdline_messaging_context() in popt_common_credentials_callback()
This adds a call to cmdline_messaging_context() to the popt popt_common_credentials_callback() hook and ensures that any client tool that uses POPT_COMMON_CREDENTIALS gets an implicit messaging context, ensuring it doesn't crash in the subsequent lp_load_client() with include=registry in a cluster. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> (cherry picked from commit 2c63ce94ef3a55ab0aa1aae4f6fee88e29ac2efe)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/popt_common_cmdline.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/lib/popt_common_cmdline.c b/source3/lib/popt_common_cmdline.c
index 57f77e0868a..d1ba90dd43e 100644
--- a/source3/lib/popt_common_cmdline.c
+++ b/source3/lib/popt_common_cmdline.c
@@ -35,6 +35,7 @@
#include "popt_common_cmdline.h"
#include "includes.h"
#include "auth_info.h"
+#include "cmdline_contexts.h"
static struct user_auth_info *cmdline_auth_info;
@@ -101,8 +102,15 @@ static void popt_common_credentials_callback(poptContext con,
}
if (reason == POPT_CALLBACK_REASON_POST) {
+ struct messaging_context *msg_ctx = NULL;
bool ok;
+ msg_ctx = cmdline_messaging_context(get_dyn_CONFIGFILE());
+ if (msg_ctx == NULL) {
+ fprintf(stderr, "Unable to initialize "
+ "messaging context\n");
+ }
+
ok = lp_load_client(get_dyn_CONFIGFILE());
if (!ok) {
const char *pname = poptGetInvocationName(con);