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>
#include "popt_common_cmdline.h"
#include "includes.h"
#include "auth_info.h"
+#include "cmdline_contexts.h"
static struct user_auth_info *cmdline_auth_info;
}
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);
bld.SAMBA3_LIBRARY('popt_samba3_cmdline',
source='lib/popt_common_cmdline.c',
- deps='popt_samba3 util_cmdline',
+ deps='popt_samba3 util_cmdline cmdline_contexts',
private_library=True)
bld.SAMBA3_LIBRARY('util_cmdline',