[SCM] Samba Shared Repository - branch v4-10-stable updated

Karolin Seeger kseeger at samba.org
Thu Mar 26 09:06:34 UTC 2020


The branch, v4-10-stable has been updated
       via  9aa60fc0e53 VERSION: Disable GIT_SNAPSHOT for the 4.10.14 release.
       via  b645568e385 WHATSNEW: Add release notes for Samba 4.10.14.
       via  d7936eab41d ctdb-tcp: Do not stop outbound connection in ctdb_tcp_node_connect()
       via  3d7da451367 ctdb-tcp: Factor out function ctdb_tcp_start_outgoing()
       via  ec0d2193c32 ctdb-tcp: add ctdb_tcp_stop_incoming()
       via  7f135cb6ceb ctdb-tcp: rename ctdb_tcp_stop_connection() to ctdb_tcp_stop_outgoing()
       via  37c03834d99 ctdb-tcp: Remove redundant restart in ctdb_tcp_tnode_cb()
       via  d156db3b084 ctdb-tcp: always call node_dead() upcall in ctdb_tcp_tnode_cb()
       via  d80e1985da7 ctdb-tcp: move free of inbound queue to TCP restart
       via  5d4e66b3df8 ctdb-daemon: more logical whitespace, debug modernisation
       via  8a3a942b520 ctdb-daemon: ensure restart() callback is called in half-connected state
       via  6528833ee7e ctdb-daemon: Rename ctdb_context private_data to transport_data
       via  f6d45183709 ctdb-daemon: Rename ctdb_node private_data to transport_data
       via  1bca6456030 nmblib: avoid undefined behaviour in handle_name_ptrs()
       via  43b343786e3 selftest: Export DC conf path for special cases
       via  1905ed84f8a selftest: Test behaviour of DNS scavenge with an existing dNSTombstoned value
       via  4bc3641a083 dsdb: Correctly handle memory in objectclass_attrs
       via  9b805c08442 wafsamba: Do not use 'rU' as the 'U' is deprecated in Python 3.9
       via  ee7e298bd70 s3: VFS: full_audit. Use system session_info if called from a temporary share definition.
       via  3230cf3e23e auth: Fix CID 1458418 Null pointer dereferences (REVERSE_INULL)
       via  11f214df1e3 auth: Fix CID 1458420 Null pointer dereferences (REVERSE_INULL)
       via  7f836b10103 ctdb-tcp: Make error handling for outbound connection consistent
       via  f3eebacb127 winbindd: handling missing idmap in getgrgid()
       via  8d069f20ec1 s3:auth_sam: map an empty domain or '.' to the local SAM name
       via  f1b3a95852a s3:selftest: test authentication with an empty userdomain and upn names
       via  f4706d85b95 s3:auth_sam: introduce effective_domain helper variables
       via  731ae2864d8 s3:auth_sam: make sure we never handle empty usernames
       via  33b37926b25 s3:auth_sam: unify the debug messages of all auth_sam*_auth() functions
       via  d5fa47e02ff s3:auth_sam: replace confusing FALL_THROUGH; with break;
       via  105e48e2712 script/release.sh: Don't use quotations any longer.
       via  677362ca796 lib:util: Log mkdir error on correct debug levels
       via  9fd10a2cacd s4:torture: Skip the deltest20 as user root
       via  55177a44258 s3: lib: nmblib. Clean up and harden nmb packet processing.
       via  9dca42f43b3 VERSION: Bump version up to 4.10.14...
      from  9678370227a VERSION: Disable GIT_SNAPSHOT for the 4.10.13 release.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-10-stable


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       |  72 ++++++++++++-
 buildtools/wafsamba/samba_utils.py                 |   2 +-
 ctdb/ib/ibw_ctdb.c                                 |  11 +-
 ctdb/ib/ibw_ctdb_init.c                            |  13 ++-
 ctdb/include/ctdb_private.h                        |   4 +-
 ctdb/server/ctdb_server.c                          |  13 ++-
 ctdb/tcp/ctdb_tcp.h                                |   3 +-
 ctdb/tcp/tcp_connect.c                             | 114 +++++++++++++--------
 ctdb/tcp/tcp_init.c                                |  20 ++--
 ctdb/tcp/tcp_io.c                                  |   5 +-
 lib/util/util.c                                    |   7 +-
 python/samba/tests/dns.py                          |  39 +++++++
 script/release.sh                                  |  26 -----
 selftest/knownfail.d/empty-domain-name             |   7 ++
 selftest/selftest.pl                               |   7 ++
 selftest/target/Samba4.pm                          |   6 ++
 source3/auth/auth_sam.c                            |  85 +++++++++++++--
 source3/libsmb/nmblib.c                            |  15 ++-
 source3/modules/vfs_full_audit.c                   |  20 +++-
 source3/selftest/tests.py                          |   8 ++
 source3/winbindd/winbindd_getgrgid.c               |   4 +
 source4/dsdb/samdb/ldb_modules/objectclass_attrs.c |  17 ++-
 source4/torture/basic/delete.c                     |   4 +
 24 files changed, 378 insertions(+), 126 deletions(-)
 create mode 100644 selftest/knownfail.d/empty-domain-name


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index e7e72c2dc8c..5428aa21c57 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=10
-SAMBA_VERSION_RELEASE=13
+SAMBA_VERSION_RELEASE=14
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index fae7ac01244..9cdd30b5755 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,3 +1,71 @@
+                   ===============================
+                   Release Notes for Samba 4.10.14
+                           March 26, 2020
+                   ===============================
+
+
+This is the last bugfix release of the Samba 4.10 release series. There will be
+security releases only beyond this point.
+
+
+Changes since 4.10.13
+---------------------
+
+o  Jeremy Allison <jra at samba.org>
+   * BUG 14239: s3: lib: nmblib. Clean up and harden nmb packet processing.
+   * BUG 14283: s3: VFS: full_audit. Use system session_info if called from a
+     temporary share definition.
+
+o  Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
+   * BUG 20193: nmblib: Avoid undefined behaviour in handle_name_ptrs().
+
+o  Andrew Bartlett <abartlet at samba.org>
+   * BUG 14258: dsdb: Correctly handle memory in objectclass_attrs.
+
+o  Volker Lendecke <vl at samba.org>
+   * BUG 14247: auth: Fix CID 1458418 Null pointer dereferences (REVERSE_INULL),
+     auth: Fix CID 1458420 Null pointer dereferences (REVERSE_INULL).
+
+o  Stefan Metzmacher <metze at samba.org>
+   * BUG 14247: winbind member (source3) fails local SAM auth with empty domain
+     name.
+   * BUG 14265: winbindd: Handling missing idmap in getgrgid().
+
+o  Andreas Schneider <asn at samba.org>
+   * BUG 14253: lib:util: Log mkdir error on correct debug levels.
+   * BUG 14266: wafsamba: Do not use 'rU' as the 'U' is deprecated in
+     Python 3.9.
+
+o  Martin Schwenke <martin at meltin.net>
+   * BUG 14274: ctdb-tcp: Make error handling for outbound connection
+     consistent.
+   * BUG 14295: Starting ctdb node that was powered off hard before results in
+     recovery loop.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
                    ===============================
                    Release Notes for Samba 4.10.13
                           January 23, 2020
@@ -96,8 +164,8 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
 
                    ===============================
                    Release Notes for Samba 4.10.12
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index bc36d1f194d..086040ebfee 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -687,7 +687,7 @@ def PROCESS_SEPARATE_RULE(self, rule):
             cache[node] = True
             self.pre_recurse(node)
             try:
-                function_code = node.read('rU', None)
+                function_code = node.read('r', None)
                 exec(compile(function_code, node.abspath(), 'exec'), self.exec_dict)
             finally:
                 self.post_recurse(node)
diff --git a/ctdb/ib/ibw_ctdb.c b/ctdb/ib/ibw_ctdb.c
index 458646faae0..53911240ff7 100644
--- a/ctdb/ib/ibw_ctdb.c
+++ b/ctdb/ib/ibw_ctdb.c
@@ -55,7 +55,8 @@ int ctdb_ibw_get_address(struct ctdb_context *ctdb,
 
 int ctdb_ibw_node_connect(struct ctdb_node *node)
 {
-	struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+	struct ctdb_ibw_node *cn = talloc_get_type(node->transport_data,
+						   struct ctdb_ibw_node);
 	int	rc;
 
 	assert(cn!=NULL);
@@ -118,7 +119,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
 		case IBWC_CONNECTED: { /* after ibw_accept or ibw_connect */
 			struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
 			if (node!=NULL) { /* after ibw_connect */
-				struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+				struct ctdb_ibw_node *cn = talloc_get_type(
+					node->transport_data,
+					struct ctdb_ibw_node);
 
 				node->ctdb->upcalls->node_connected(node);
 				ctdb_flush_cn_queue(cn);
@@ -136,7 +139,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
 		case IBWC_ERROR: {
 			struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
 			if (node!=NULL) {
-				struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+				struct ctdb_ibw_node *cn = talloc_get_type(
+					node->transport_data,
+					struct ctdb_ibw_node);
 				struct ibw_ctx *ictx = cn->conn->ctx;
 
 				DEBUG(DEBUG_DEBUG, ("IBWC_ERROR, reconnecting...\n"));
diff --git a/ctdb/ib/ibw_ctdb_init.c b/ctdb/ib/ibw_ctdb_init.c
index 7e77ec08031..f9d00c60605 100644
--- a/ctdb/ib/ibw_ctdb_init.c
+++ b/ctdb/ib/ibw_ctdb_init.c
@@ -40,7 +40,8 @@
 
 static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog)
 {
-	struct ibw_ctx *ictx = talloc_get_type(ctdb->private_data, struct ibw_ctx);
+	struct ibw_ctx *ictx = talloc_get_type(ctdb->transport_data,
+					       struct ibw_ctx);
 
 	assert(ictx!=NULL);
 
@@ -62,12 +63,13 @@ static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog)
  */
 static int ctdb_ibw_add_node(struct ctdb_node *node)
 {
-	struct ibw_ctx *ictx = talloc_get_type(node->ctdb->private_data, struct ibw_ctx);
+	struct ibw_ctx *ictx = talloc_get_type(node->ctdb->transport_data,
+					       struct ibw_ctx);
 	struct ctdb_ibw_node *cn = talloc_zero(node, struct ctdb_ibw_node);
 
 	assert(cn!=NULL);
 	cn->conn = ibw_conn_new(ictx, node);
-	node->private_data = (void *)cn;
+	node->transport_data = (void *)cn;
 
 	return (cn->conn!=NULL ? 0 : -1);
 }
@@ -153,7 +155,8 @@ int ctdb_flush_cn_queue(struct ctdb_ibw_node *cn)
 
 static int ctdb_ibw_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
 {
-	struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+	struct ctdb_ibw_node *cn = talloc_get_type(node->transport_data,
+						   struct ctdb_ibw_node);
 	int	rc;
 
 	assert(length>=sizeof(uint32_t));
@@ -245,7 +248,7 @@ int ctdb_ibw_init(struct ctdb_context *ctdb)
 	}
 
 	ctdb->methods = &ctdb_ibw_methods;
-	ctdb->private_data = ictx;
+	ctdb->transport_data = ictx;
 	
 	DEBUG(DEBUG_DEBUG, ("ctdb_ibw_init succeeded.\n"));
 	return 0;
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 0c66725d36c..2c0658eabf3 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -74,7 +74,7 @@ struct ctdb_node {
 	struct ctdb_context *ctdb;
 	ctdb_sock_addr address;
 	const char *name; /* for debug messages */
-	void *private_data; /* private to transport */
+	void *transport_data; /* private to transport */
 	uint32_t pnn;
 	uint32_t flags;
 
@@ -286,7 +286,7 @@ struct ctdb_context {
 	char *err_msg;
 	const struct ctdb_methods *methods; /* transport methods */
 	const struct ctdb_upcalls *upcalls; /* transport upcalls */
-	void *private_data; /* private to transport */
+	void *transport_data; /* private to transport */
 	struct ctdb_db_context *db_list;
 	struct srvid_context *srv;
 	struct srvid_context *tunnels;
diff --git a/ctdb/server/ctdb_server.c b/ctdb/server/ctdb_server.c
index ddff85b81c5..3fce791b27e 100644
--- a/ctdb/server/ctdb_server.c
+++ b/ctdb/server/ctdb_server.c
@@ -301,6 +301,12 @@ done:
 */
 void ctdb_node_dead(struct ctdb_node *node)
 {
+	if (node->ctdb->methods == NULL) {
+		DBG_ERR("Can not restart transport while shutting down\n");
+		return;
+	}
+	node->ctdb->methods->restart(node);
+
 	if (node->flags & NODE_FLAGS_DISCONNECTED) {
 		DEBUG(DEBUG_INFO,("%s: node %s is already marked disconnected: %u connected\n", 
 			 node->ctdb->name, node->name, 
@@ -315,13 +321,6 @@ void ctdb_node_dead(struct ctdb_node *node)
 	DEBUG(DEBUG_ERR,("%s: node %s is dead: %u connected\n",
 		 node->ctdb->name, node->name, node->ctdb->num_connected));
 	ctdb_daemon_cancel_controls(node->ctdb, node);
-
-	if (node->ctdb->methods == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Can not restart transport while shutting down daemon.\n"));
-		return;
-	}
-
-	node->ctdb->methods->restart(node);
 }
 
 /*
diff --git a/ctdb/tcp/ctdb_tcp.h b/ctdb/tcp/ctdb_tcp.h
index daabad74297..cb8d66fa5dc 100644
--- a/ctdb/tcp/ctdb_tcp.h
+++ b/ctdb/tcp/ctdb_tcp.h
@@ -48,7 +48,8 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
 			   struct timeval t, void *private_data);
 void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args);
 void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data);
-void ctdb_tcp_stop_connection(struct ctdb_node *node);
+void ctdb_tcp_stop_outgoing(struct ctdb_node *node);
+void ctdb_tcp_stop_incoming(struct ctdb_node *node);
 
 #define CTDB_TCP_ALIGNMENT 8
 
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index 0b5d021480a..6ce3dc16a6d 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -38,12 +38,12 @@
 #include "ctdb_tcp.h"
 
 /*
-  stop any connecting (established or pending) to a node
+  stop any outgoing connection (established or pending) to a node
  */
-void ctdb_tcp_stop_connection(struct ctdb_node *node)
+void ctdb_tcp_stop_outgoing(struct ctdb_node *node)
 {
 	struct ctdb_tcp_node *tnode = talloc_get_type(
-		node->private_data, struct ctdb_tcp_node);
+		node->transport_data, struct ctdb_tcp_node);
 
 	TALLOC_FREE(tnode->out_queue);
 	TALLOC_FREE(tnode->connect_te);
@@ -54,6 +54,16 @@ void ctdb_tcp_stop_connection(struct ctdb_node *node)
 	}
 }
 
+/*
+  stop incoming connection to a node
+ */
+void ctdb_tcp_stop_incoming(struct ctdb_node *node)
+{
+	struct ctdb_tcp_node *tnode = talloc_get_type(
+		node->transport_data, struct ctdb_tcp_node);
+
+	TALLOC_FREE(tnode->in_queue);
+}
 
 /*
   called when a complete packet has come in - should not happen on this socket
@@ -62,17 +72,9 @@ void ctdb_tcp_stop_connection(struct ctdb_node *node)
 void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data)
 {
 	struct ctdb_node *node = talloc_get_type(private_data, struct ctdb_node);
-	struct ctdb_tcp_node *tnode = talloc_get_type(
-		node->private_data, struct ctdb_tcp_node);
 
-	if (data == NULL) {
-		node->ctdb->upcalls->node_dead(node);
-	}
+	node->ctdb->upcalls->node_dead(node);
 
-	ctdb_tcp_stop_connection(node);
-	tnode->connect_te = tevent_add_timer(node->ctdb->ev, tnode,
-					     timeval_current_ofs(3, 0),
-					     ctdb_tcp_node_connect, node);
 	TALLOC_FREE(data);
 }
 
@@ -85,7 +87,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev,
 {
 	struct ctdb_node *node = talloc_get_type(private_data,
 						 struct ctdb_node);
-	struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data,
+	struct ctdb_tcp_node *tnode = talloc_get_type(node->transport_data,
 						      struct ctdb_tcp_node);
 	struct ctdb_context *ctdb = node->ctdb;
 	int error = 0;
@@ -98,7 +100,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev,
 
 	ret = getsockopt(tnode->out_fd, SOL_SOCKET, SO_ERROR, &error, &len);
 	if (ret != 0 || error != 0) {
-		ctdb_tcp_stop_connection(node);
+		ctdb_tcp_stop_outgoing(node);
 		tnode->connect_te = tevent_add_timer(ctdb->ev, tnode,
 						    timeval_current_ofs(1, 0),
 						    ctdb_tcp_node_connect, node);
@@ -136,7 +138,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev,
 					    node->name);
 	if (tnode->out_queue == NULL) {
 		DBG_ERR("Failed to set up outgoing queue\n");
-		ctdb_tcp_stop_connection(node);
+		ctdb_tcp_stop_outgoing(node);
 		tnode->connect_te = tevent_add_timer(ctdb->ev,
 						     tnode,
 						     timeval_current_ofs(1, 0),
@@ -159,15 +161,17 @@ static void ctdb_node_connect_write(struct tevent_context *ev,
 }
 
 
+static void ctdb_tcp_node_connect_timeout(struct tevent_context *ev,
+					  struct tevent_timer *te,
+					  struct timeval t,
+					  void *private_data);
+
 /*
   called when we should try and establish a tcp connection to a node
 */
-void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
-			   struct timeval t, void *private_data)
+static void ctdb_tcp_start_outgoing(struct ctdb_node *node)
 {
-	struct ctdb_node *node = talloc_get_type(private_data,
-						 struct ctdb_node);
-	struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data, 
+	struct ctdb_tcp_node *tnode = talloc_get_type(node->transport_data,
 						      struct ctdb_tcp_node);
 	struct ctdb_context *ctdb = node->ctdb;
         ctdb_sock_addr sock_in;
@@ -176,23 +180,19 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
         ctdb_sock_addr sock_out;
 	int ret;
 
-	ctdb_tcp_stop_connection(node);
-
 	sock_out = node->address;
 
 	tnode->out_fd = socket(sock_out.sa.sa_family, SOCK_STREAM, IPPROTO_TCP);
 	if (tnode->out_fd == -1) {
 		DBG_ERR("Failed to create socket\n");
-		return;
+		goto failed;
 	}
 
 	ret = set_blocking(tnode->out_fd, false);
 	if (ret != 0) {
 		DBG_ERR("Failed to set socket non-blocking (%s)\n",
 			strerror(errno));
-		close(tnode->out_fd);
-		tnode->out_fd = -1;
-		return;
+		goto failed;
 	}
 
 	set_close_on_exec(tnode->out_fd);
@@ -224,32 +224,22 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
 		sockout_size = sizeof(sock_out.ip6);
 		break;
 	default:
-		DEBUG(DEBUG_ERR, (__location__ " unknown family %u\n",
-			sock_in.sa.sa_family));
-		close(tnode->out_fd);
-		tnode->out_fd = -1;
-		return;
+		DBG_ERR("Unknown address family %u\n", sock_in.sa.sa_family);
+		/* Can't happen to due to address parsing restrictions */
+		goto failed;
 	}
 
 	ret = bind(tnode->out_fd, (struct sockaddr *)&sock_in, sockin_size);
 	if (ret == -1) {
 		DBG_ERR("Failed to bind socket (%s)\n", strerror(errno));
-		close(tnode->out_fd);
-		tnode->out_fd = -1;
-		return;
+		goto failed;
 	}
 
 	ret = connect(tnode->out_fd,
 		      (struct sockaddr *)&sock_out,
 		      sockout_size);
 	if (ret != 0 && errno != EINPROGRESS) {
-		ctdb_tcp_stop_connection(node);
-		tnode->connect_te = tevent_add_timer(ctdb->ev,
-						     tnode,
-						     timeval_current_ofs(1, 0),
-						     ctdb_tcp_node_connect,
-						     node);
-		return;
+		goto failed;
 	}
 
 	/* non-blocking connect - wait for write event */
@@ -263,6 +253,16 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
 	/* don't give it long to connect - retry in one second. This ensures
 	   that we find a node is up quickly (tcp normally backs off a syn reply
 	   delay by quite a lot) */
+	tnode->connect_te = tevent_add_timer(ctdb->ev,
+					     tnode,
+					     timeval_current_ofs(1, 0),
+					     ctdb_tcp_node_connect_timeout,
+					     node);
+
+	return;
+
+failed:
+	ctdb_tcp_stop_outgoing(node);
 	tnode->connect_te = tevent_add_timer(ctdb->ev,
 					     tnode,
 					     timeval_current_ofs(1, 0),
@@ -270,6 +270,29 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
 					     node);
 }
 
+void ctdb_tcp_node_connect(struct tevent_context *ev,
+			   struct tevent_timer *te,
+			   struct timeval t,
+			   void *private_data)
+{
+	struct ctdb_node *node = talloc_get_type_abort(private_data,
+						       struct ctdb_node);
+
+	ctdb_tcp_start_outgoing(node);
+}
+
+static void ctdb_tcp_node_connect_timeout(struct tevent_context *ev,
+					  struct tevent_timer *te,
+					  struct timeval t,
+					  void *private_data)
+{
+	struct ctdb_node *node = talloc_get_type_abort(private_data,
+						       struct ctdb_node);
+
+	ctdb_tcp_stop_outgoing(node);
+	ctdb_tcp_start_outgoing(node);
+}
+
 /*
   called when we get contacted by another node
   currently makes no attempt to check if the connection is really from a ctdb
@@ -279,7 +302,8 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
 			      uint16_t flags, void *private_data)
 {
 	struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
-	struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private_data, struct ctdb_tcp);
+	struct ctdb_tcp *ctcp = talloc_get_type(ctdb->transport_data,
+						struct ctdb_tcp);
 	ctdb_sock_addr addr;
 	socklen_t len;
 	int fd;
@@ -302,7 +326,7 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
 		return;
 	}
 
-	tnode = talloc_get_type_abort(node->private_data,
+	tnode = talloc_get_type_abort(node->transport_data,
 				      struct ctdb_tcp_node);
 	if (tnode == NULL) {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list