summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2015-08-14 12:54:00 +0200
committerStefan Metzmacher <metze@samba.org>2015-08-18 01:35:43 +0200
commit88c53b84aeb492f95d4913600eab2fc22eceb515 (patch)
tree49bc5c58df44943d6583866219c85642c430126d
parent2aff77c172de0b87553cc2754f22af6613b9288c (diff)
downloadsamba-88c53b84aeb492f95d4913600eab2fc22eceb515.tar.gz
s3:lib: fix some corner cases of open_socket_out_cleanup()
In case of timeouts we retry the async_connect_send() and forgot to remember it, this results in an abort() in async_connect_cleanup() as the fd is already closed when calling fcntl(F_SETFL). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit ce3c77fb45ccf4d45a0fa655325e30e748d89245) Autobuild-User(v4-3-test): Stefan Metzmacher <metze@samba.org> Autobuild-Date(v4-3-test): Tue Aug 18 01:35:44 CEST 2015 on sn-devel-104
-rw-r--r--source3/lib/util_sock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index a8a9ccac11f..cb57f84a1f3 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -580,6 +580,7 @@ static void open_socket_out_connected(struct tevent_req *subreq)
tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
+ state->connect_subreq = subreq;
tevent_req_set_callback(subreq, open_socket_out_connected, req);
return;
}
@@ -602,10 +603,12 @@ NTSTATUS open_socket_out_recv(struct tevent_req *req, int *pfd)
NTSTATUS status;
if (tevent_req_is_nterror(req, &status)) {
+ tevent_req_received(req);
return status;
}
*pfd = state->fd;
state->fd = -1;
+ tevent_req_received(req);
return NT_STATUS_OK;
}