FreeBSD Bugzilla – Attachment 209638 Details for
Bug 242395
net/samba410: CLI tools still printing "Unable to initialize messaging context"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
samba-4.10.10_1.patch
samba-4.10.10_1.patch (text/plain), 7.88 KB, created by
takefu
on 2019-12-03 05:30:41 UTC
(
hide
)
Description:
samba-4.10.10_1.patch
Filename:
MIME Type:
Creator:
takefu
Created:
2019-12-03 05:30:41 UTC
Size:
7.88 KB
patch
obsolete
>--- /usr/ports/net/samba410/Makefile 2019-11-24 01:30:16.152014000 +0000 >+++ Makefile 2019-12-03 05:25:27.304068000 +0000 >@@ -3,7 +3,7 @@ > > PORTNAME= ${SAMBA4_BASENAME}410 > PORTVERSION= ${SAMBA4_VERSION} >-PORTREVISION= 0 >+PORTREVISION= 1 > CATEGORIES?= net > MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc > DISTNAME= ${SAMBA4_DISTNAME} >@@ -19,8 +19,9 @@ CONFLICTS_INSTALL?= samba4-4.0.* samba4 > > USES= cpe > >-EXTRA_PATCHES+= ${PATCHDIR}/0001-Zfs-provision-1.patch:-p1 >-EXTRA_PATCHES+= ${PATCHDIR}/0001-provision-use-ASCII-quotes.patch:-p1 >+EXTRA_PATCHES+= ${PATCHDIR}/0001-Zfs-provision-1.patch:-p1\ >+ ${PATCHDIR}/0001-provision-use-ASCII-quotes.patch:-p1\ >+ ${PATCHDIR}/0001-initialize-messaging-before-getting-the-ctdb-connection.patch:-p1 > > SAMBA4_BASENAME= samba > SAMBA4_PORTNAME= ${SAMBA4_BASENAME}4 >--- /dev/null 2019-12-03 05:25:52.000000000 +0000 >+++ files/0001-initialize-messaging-before-getting-the-ctdb-connection.patch 2019-12-03 05:17:25.338165000 +0000 >@@ -0,0 +1,205 @@ >+From 6947e4141016bb140dfae62cd71be9d9ba5d7060 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 #13465. >+ >+Bug: https://bugzilla.samba.org/show_bug.cgi?id=13925 >+ >+Signed-off-by: Ralph Boehme <slow@samba.org> >+Reviewed-by: Jeremy Allison <jra@samba.org> >+(cherry picked from commit ca95d7f41b683b4d7ac59ed6ee709d44abfe2019) >+--- >+ source3/lib/dbwrap/dbwrap_open.c | 8 +++++++- >+ 1 file changed, 7 insertions(+), 1 deletion(-) >+ >+diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c >+index c8dfd9103a8..20084bca471 100644 >+--- a/source3/lib/dbwrap/dbwrap_open.c >++++ b/source3/lib/dbwrap/dbwrap_open.c >+@@ -141,13 +141,19 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, >+ struct messaging_context *msg_ctx; >+ struct ctdbd_connection *conn; >+ >++ /* >++ * Initialize messaging before getting the ctdb >++ * connection, as the ctdb connection requires messaging >++ * to be initialized. >++ */ >++ 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.21.0 >+ >+ >+From ca5652c7ee22955fb1690534fe33759ccb008ee5 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 before initializing messaging. The previous commit fixed that so we >+can now safely remove the calls to cmdline_messaging_context() from all tools >+that don't use messaging. >+ >+Bug: https://bugzilla.samba.org/show_bug.cgi?id=13925 >+ >+Signed-off-by: Ralph Boehme <slow@samba.org> >+Reviewed-by: Jeremy Allison <jra@samba.org> >+ >+Autobuild-User(master): Jeremy Allison <jra@samba.org> >+Autobuild-Date(master): Thu Oct 24 09:33:47 UTC 2019 on sn-devel-184 >+ >+(cherry picked from commit 9471508391fd3bcf199b1e94f8d9ee2b956e8f8e) >+--- >+ 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 79e34847f48..39a787510a3 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 74f8c3b0b2f..14edbaeceea 100644 >+--- a/source3/utils/pdbedit.c >++++ b/source3/utils/pdbedit.c >+@@ -1128,8 +1128,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.21.0 >+
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 242395
: 209638