[SCM] Samba Shared Repository - branch v3-6-test updated

Karolin Seeger kseeger at samba.org
Tue Aug 30 12:57:49 MDT 2011


The branch, v3-6-test has been updated
       via  45392d0 s3: Fix bug 8385
      from  225c66a Fix bug Bug 8422 - Infinite loop in ACL module code.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit 45392d05ff059987fb76d3818969177b5a5de6b0
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Aug 22 14:16:26 2011 +0200

    s3: Fix bug 8385
    
    Poll and select behave differently regarding error handling. When doing the
    connect(2), we can not rely on poll telling us both readability and writability
    upon error. Just always try a second connect(2). At least on Linux it returns 0
    when it succeeded.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Thu Aug 25 19:39:12 CEST 2011 on sn-devel-104
    (cherry picked from commit 50e30afa608dfdeae8a260730ead9761ed424dad)

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

Summary of changes:
 lib/async_req/async_sock.c |   40 ++++++++++++++--------------------------
 1 files changed, 14 insertions(+), 26 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index 2c90b6d..bb8518f 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -325,36 +325,24 @@ static void async_connect_connected(struct tevent_context *ev,
 		priv, struct tevent_req);
 	struct async_connect_state *state =
 		tevent_req_data(req, struct async_connect_state);
+	int ret;
 
-	/*
-	 * Stevens, Network Programming says that if there's a
-	 * successful connect, the socket is only writable. Upon an
-	 * error, it's both readable and writable.
-	 */
-	if ((flags & (TEVENT_FD_READ|TEVENT_FD_WRITE))
-	    == (TEVENT_FD_READ|TEVENT_FD_WRITE)) {
-		int ret;
-
-		ret = connect(state->fd,
-			      (struct sockaddr *)(void *)&state->address,
-			      state->address_len);
-		if (ret == 0) {
-			TALLOC_FREE(fde);
-			tevent_req_done(req);
-			return;
-		}
-
-		if (errno == EINPROGRESS) {
-			/* Try again later, leave the fde around */
-			return;
-		}
+	ret = connect(state->fd, (struct sockaddr *)(void *)&state->address,
+		      state->address_len);
+	if (ret == 0) {
+		state->sys_errno = 0;
 		TALLOC_FREE(fde);
-		tevent_req_error(req, errno);
+		tevent_req_done(req);
 		return;
 	}
-
-	state->sys_errno = 0;
-	tevent_req_done(req);
+	if (errno == EINPROGRESS) {
+		/* Try again later, leave the fde around */
+		return;
+	}
+	state->sys_errno = errno;
+	TALLOC_FREE(fde);
+	tevent_req_error(req, errno);
+	return;
 }
 
 int async_connect_recv(struct tevent_req *req, int *perrno)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list