diff options
author | davilla <davilla@4pi.com> | 2011-09-04 12:48:04 -0400 |
---|---|---|
committer | davilla <davilla@4pi.com> | 2011-09-04 12:48:04 -0400 |
commit | 54307c736b88428b6e4222081cd6e1b8701442c3 (patch) | |
tree | 635bc87138dfdfb4c272a9e554bb9d5ef4da7a07 /tools/darwin | |
parent | bb1417b344289f547b5a64a5226bc0efdfe7b769 (diff) |
[osx/ios] fixed, smbclient would not fallback to port 139. This is a samba 3.6.0 bugfix for (Bug 8385 - smbclient can't access a NT4 share since 3.6.0)
Diffstat (limited to 'tools/darwin')
-rw-r--r-- | tools/darwin/depends/samba/01-bugfix-8385.patch | 71 | ||||
-rw-r--r-- | tools/darwin/depends/samba/Makefile | 1 |
2 files changed, 72 insertions, 0 deletions
diff --git a/tools/darwin/depends/samba/01-bugfix-8385.patch b/tools/darwin/depends/samba/01-bugfix-8385.patch new file mode 100644 index 0000000000..1cf5f6c879 --- /dev/null +++ b/tools/darwin/depends/samba/01-bugfix-8385.patch @@ -0,0 +1,71 @@ +From bfe8e8f0cd2f2f808c211d831c29f5d06239b1c8 Mon Sep 17 00:00:00 2001 +From: Volker Lendecke <vl@samba.org> +Date: Mon, 22 Aug 2011 14:16:26 +0200 +Subject: [PATCH] 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. +--- + lib/async_req/async_sock.c | 40 ++++++++++++++-------------------------- + 1 files changed, 14 insertions(+), 26 deletions(-) + +diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c +index 43de837..f6fcf3b 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) +-- +1.7.1 + diff --git a/tools/darwin/depends/samba/Makefile b/tools/darwin/depends/samba/Makefile index 00b39b8c4f..67cd3cc5a3 100644 --- a/tools/darwin/depends/samba/Makefile +++ b/tools/darwin/depends/samba/Makefile @@ -22,6 +22,7 @@ $(LIBDYLIB): $(TARBALLS_LOCATION)/$(ARCHIVE) rm -rf $(SOURCE) $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) echo $(SOURCE) > .gitignore + cd $(SOURCE); patch -p1 < ../01-bugfix-8385.patch cd $(SOURCE)/source3; ./autogen.sh cd $(SOURCE)/source3; $(CONFIGURE) if test "$(DARWIN)" = "ios"; then \ |