[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Fri Jul 1 18:35:01 UTC 2022
The branch, master has been updated
via 96b77d87639 s3:dbwrap_ctdb: improve the error handling in ctdb_async_ctx_init_internal()
via c5ef91865d4 s3:ctdbd_conn: make sure ctdbd_init_async_connection() never returns 0 with conn = NULL
from b609734c52d testparm: clarify "Weak crypto is allowed" message
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 96b77d87639ca3c88df9208861a131f29971df8a
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jun 13 11:35:31 2022 +0200
s3:dbwrap_ctdb: improve the error handling in ctdb_async_ctx_init_internal()
We should not map any error from ctdbd_init_async_connection() to EIO.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Jul 1 18:34:17 UTC 2022 on sn-devel-184
commit c5ef91865d49c516a272a91eb35d20b23838a5ce
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jun 13 11:32:30 2022 +0200
s3:ctdbd_conn: make sure ctdbd_init_async_connection() never returns 0 with conn = NULL
This should not happen anywhere, but it clears the expectation of the
caller and simplifies the error handling there.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/lib/ctdbd_conn.c | 3 +++
source3/lib/dbwrap/dbwrap_ctdb.c | 12 +++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 8fe94226590..dd9206b00fd 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -538,6 +538,8 @@ int ctdbd_init_async_connection(
struct ctdbd_connection *conn = NULL;
int ret;
+ *pconn = NULL;
+
ret = ctdbd_init_connection(mem_ctx, sockname, timeout, &conn);
if (ret != 0) {
return ret;
@@ -546,6 +548,7 @@ int ctdbd_init_async_connection(
ret = set_blocking(conn->fd, false);
if (ret == -1) {
int err = errno;
+ SMB_ASSERT(err != 0);
TALLOC_FREE(conn);
return err;
}
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 0907089164a..c0af5729f32 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -99,11 +99,17 @@ static int ctdb_async_ctx_init_internal(TALLOC_CTX *mem_ctx,
&ctdb_async_ctx.async_conn);
unbecome_root();
- if (ret != 0 || ctdb_async_ctx.async_conn == NULL) {
- DBG_ERR("ctdbd_init_connection failed\n");
- return EIO;
+ if (ret != 0) {
+ DBG_ERR("ctdbd_init_async_connection(%s, timeout=%d) "
+ "failed: ret=%d %s\n",
+ lp_ctdbd_socket(),
+ lp_ctdb_timeout(),
+ ret, strerror(ret));
+ return ret;
}
+ SMB_ASSERT(ctdb_async_ctx.async_conn != NULL);
+
ctdb_async_ctx.initialized = true;
return 0;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list