[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Fri Oct 5 14:17:03 UTC 2018


The branch, master has been updated
       via  6784ff2 ctdbd_conn: Generalise inaccurate error message
       via  54207bb s4/auth/tests: Fix kerberos test string size
      from  43a0e63 leases: Streamline leases_db_key a bit

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6784ff24b8a31b9d597d24cab6e34feea2b83e29
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Oct 5 14:04:18 2018 +1000

    ctdbd_conn: Generalise inaccurate error message
    
    Seeing:
    
      ctdb_read_packet failed: Cannot allocate memory
      [...,  0] ../source3/lib/ctdbd_conn.c:121(cluster_fatal)
      cluster fatal event: ctdbd died
    
    The error is due to a memory allocation failure rather than ctdbd
    dying.  However, the error message makes people wonder why ctdbd died.
    
    Another alternative would be to wrap cluster_fatal() and have the
    wrapper interpret the return value from ctdb_read_packet() to choose
    from a set of more precise messages to pass to cluster_fatal().  For a
    memory allocation it isn't strictly necessary to call cluster_fatal(),
    but all is probably lost and it is still probably better to try to
    exit cleanly as soon as possible instead of crashing somewhere.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Fri Oct  5 16:16:29 CEST 2018 on sn-devel-144

commit 54207bb3b2e18cf36c2a5585f9847326930b33ed
Author: Alexander Bokovoy <ab at samba.org>
Date:   Wed Oct 3 22:48:00 2018 +0300

    s4/auth/tests: Fix kerberos test string size
    
    >>> len("user0 at samba.example.com")
    23
    
    But the string definition does not take a final '\0' into account.
    As per Volker's suggestion, use compiler's support to allocate
    the string properly.
    
    Signed-off-by: Alexander Bokovoy <ab at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/ctdbd_conn.c      | 13 ++++++-------
 source4/auth/tests/kerberos.c |  4 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index dc6aa28..d5fac57 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -405,8 +405,8 @@ static int ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid,
 
 	ret = ctdb_read_packet(conn->fd, conn->timeout, mem_ctx, &hdr);
 	if (ret != 0) {
-		DEBUG(0, ("ctdb_read_packet failed: %s\n", strerror(ret)));
-		cluster_fatal("ctdbd died\n");
+		DBG_ERR("ctdb_read_packet failed: %s\n", strerror(ret));
+		cluster_fatal("failed to read data from ctdbd\n");
 	}
 
 	DEBUG(11, ("Received ctdb packet\n"));
@@ -601,8 +601,8 @@ void ctdbd_socket_readable(struct tevent_context *ev,
 
 	ret = ctdb_read_packet(conn->fd, conn->timeout, talloc_tos(), &hdr);
 	if (ret != 0) {
-		DEBUG(0, ("ctdb_read_packet failed: %s\n", strerror(ret)));
-		cluster_fatal("ctdbd died\n");
+		DBG_ERR("ctdb_read_packet failed: %s\n", strerror(ret));
+		cluster_fatal("failed to read data from ctdbd\n");
 	}
 
 	ret = ctdb_handle_message(ev, conn, hdr);
@@ -1082,9 +1082,8 @@ int ctdbd_traverse(struct ctdbd_connection *conn, uint32_t db_id,
 
 		ret = ctdb_read_packet(conn->fd, conn->timeout, conn, &hdr);
 		if (ret != 0) {
-			DEBUG(0, ("ctdb_read_packet failed: %s\n",
-				  strerror(ret)));
-			cluster_fatal("ctdbd died\n");
+			DBG_ERR("ctdb_read_packet failed: %s\n", strerror(ret));
+			cluster_fatal("failed to read data from ctdbd\n");
 		}
 
 		if (hdr->operation != CTDB_REQ_MESSAGE) {
diff --git a/source4/auth/tests/kerberos.c b/source4/auth/tests/kerberos.c
index 703c806..fcc8ac4 100644
--- a/source4/auth/tests/kerberos.c
+++ b/source4/auth/tests/kerberos.c
@@ -25,8 +25,8 @@ static void internal_obsolete_keytab_test(int num_principals, int num_kvnos,
 	krb5_error_code code;
 
 	int i,j;
-	char princ_name[6] = "user0";
-	char expect_princ_name[23] = "user0 at samba.example.com";
+	char princ_name[] = "user0";
+	char expect_princ_name[] = "user0 at samba.example.com";
 	bool found_previous;
 	const char *error_str;
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list