The Samba-Bugzilla – Attachment 15119 Details for
Bug 13925
CLI tools still printing "Unable to initialize messaging context"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP patch for master
bug13925-master.patch (text/plain), 6.27 KB, created by
Ralph Böhme
on 2019-05-04 11:04:45 UTC
(
hide
)
Description:
WIP patch for master
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2019-05-04 11:04:45 UTC
Size:
6.27 KB
patch
obsolete
>From 886792da0333728a21caf3d0463196cf16944854 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Sat, 4 May 2019 12:12:04 +0200 >Subject: [PATCH 1/2] s3:dbwrap: initialize messaging before getting the ctdb > connection > >This is a better fix for bug #13645. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=13925 >--- > source3/lib/dbwrap/dbwrap_open.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > >diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c >index c8dfd9103a8..70e3b606d2a 100644 >--- a/source3/lib/dbwrap/dbwrap_open.c >+++ b/source3/lib/dbwrap/dbwrap_open.c >@@ -141,13 +141,20 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, > struct messaging_context *msg_ctx; > struct ctdbd_connection *conn; > >+ /* >+ * Initialize messaging before getting the ctdb >+ * messaging connection object, as the former >+ * initializes the latter. This is the real fix for >+ * bug #13645. >+ */ >+ msg_ctx = global_messaging_context(); >+ > conn = messaging_ctdb_connection(); > if (conn == NULL) { > DBG_WARNING("No ctdb connection\n"); > errno = EIO; > return NULL; > } >- msg_ctx = global_messaging_context(); > > result = db_open_ctdb(mem_ctx, msg_ctx, base, > hash_size, >-- >2.20.1 > > >From faacd6ef12bf3061f45cd6289b87823098eeac0e Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Sat, 4 May 2019 12:12:48 +0200 >Subject: [PATCH 2/2] s3: remove now unneeded call to > cmdline_messaging_context() > >This was only needed as dbwrap_open() had a bug where it asked for the ctdb >connection object before initializing messaging. The previous commit fixed that >so we can now safely remove the calls to cmdline_messaging_context() from all >tools. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=13925 >--- > source3/lib/popt_common_cmdline.c | 7 ------- > source3/utils/dbwrap_tool.c | 2 -- > source3/utils/eventlogadm.c | 3 --- > source3/utils/ntlm_auth.c | 2 -- > source3/utils/pdbedit.c | 2 -- > source3/utils/sharesec.c | 1 - > source3/utils/smbget.c | 2 -- > source3/utils/smbpasswd.c | 2 -- > source3/utils/testparm.c | 2 -- > 9 files changed, 23 deletions(-) > >diff --git a/source3/lib/popt_common_cmdline.c b/source3/lib/popt_common_cmdline.c >index 95abec1a440..6d5e13a3160 100644 >--- a/source3/lib/popt_common_cmdline.c >+++ b/source3/lib/popt_common_cmdline.c >@@ -102,15 +102,8 @@ 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); >diff --git a/source3/utils/dbwrap_tool.c b/source3/utils/dbwrap_tool.c >index 2808a5d68bf..153a4459ee0 100644 >--- a/source3/utils/dbwrap_tool.c >+++ b/source3/utils/dbwrap_tool.c >@@ -422,8 +422,6 @@ int main(int argc, const char **argv) > while (extra_argv[extra_argc]) extra_argc++; > } > >- cmdline_messaging_context(get_dyn_CONFIGFILE()); >- > lp_load_global(get_dyn_CONFIGFILE()); > > if ((extra_argc < 2) || (extra_argc > 5)) { >diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c >index db874dfae8a..2770fffa48c 100644 >--- a/source3/utils/eventlogadm.c >+++ b/source3/utils/eventlogadm.c >@@ -473,9 +473,6 @@ int main( int argc, char *argv[] ) > exit( 1 ); > } > >- cmdline_messaging_context(configfile == NULL ? >- get_dyn_CONFIGFILE() : configfile); >- > if ( configfile == NULL ) { > lp_load_global(get_dyn_CONFIGFILE()); > } else if (!lp_load_global(configfile)) { >diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c >index 2be641c891c..87f6554ae4f 100644 >--- a/source3/utils/ntlm_auth.c >+++ b/source3/utils/ntlm_auth.c >@@ -2504,8 +2504,6 @@ enum { > > poptFreeContext(pc); > >- cmdline_messaging_context(get_dyn_CONFIGFILE()); >- > if (!lp_load_global(get_dyn_CONFIGFILE())) { > d_fprintf(stderr, "ntlm_auth: error opening config file %s. Error was %s\n", > get_dyn_CONFIGFILE(), strerror(errno)); >diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c >index 462c753217e..44b59a94d35 100644 >--- a/source3/utils/pdbedit.c >+++ b/source3/utils/pdbedit.c >@@ -1125,8 +1125,6 @@ int main(int argc, const char **argv) > if (user_name == NULL) > user_name = poptGetArg(pc); > >- cmdline_messaging_context(get_dyn_CONFIGFILE()); >- > if (!lp_load_global(get_dyn_CONFIGFILE())) { > fprintf(stderr, "Can't load %s - run testparm to debug it\n", get_dyn_CONFIGFILE()); > exit(1); >diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c >index 2ea81b9adfa..10c347eaac3 100644 >--- a/source3/utils/sharesec.c >+++ b/source3/utils/sharesec.c >@@ -501,7 +501,6 @@ int main(int argc, const char *argv[]) > > setlinebuf(stdout); > >- cmdline_messaging_context(get_dyn_CONFIGFILE()); > lp_load_with_registry_shares(get_dyn_CONFIGFILE()); > > /* check for initializing secrets.tdb first */ >diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c >index 58690be56e3..a948a336445 100644 >--- a/source3/utils/smbget.c >+++ b/source3/utils/smbget.c >@@ -1003,8 +1003,6 @@ int main(int argc, char **argv) > > popt_burn_cmdline_password(argc, argv); > >- cmdline_messaging_context(get_dyn_CONFIGFILE()); >- > if (smbc_init(get_auth_data, opt.debuglevel) < 0) { > fprintf(stderr, "Unable to initialize libsmbclient\n"); > return 1; >diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c >index 8e2b9d7f80f..a6509abe5cb 100644 >--- a/source3/utils/smbpasswd.c >+++ b/source3/utils/smbpasswd.c >@@ -197,8 +197,6 @@ static int process_options(int argc, char **argv, int local_flags) > usage(); > } > >- cmdline_messaging_context(configfile); >- > if (!lp_load_global(configfile)) { > fprintf(stderr, "Can't load %s - run testparm to debug it\n", > configfile); >diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c >index efa58a6a417..9ba625da4bf 100644 >--- a/source3/utils/testparm.c >+++ b/source3/utils/testparm.c >@@ -742,8 +742,6 @@ static void do_per_share_checks(int s) > goto done; > } > >- cmdline_messaging_context(config_file); >- > fprintf(stderr,"Load smb config files from %s\n",config_file); > > if (!lp_load_with_registry_shares(config_file)) { >-- >2.20.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 13925
: 15119 |
15610