summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2010-01-06 12:13:35 +0800
committerBo Yang <boyang@samba.org>2010-01-06 19:19:35 +0800
commit36493bf2f6634b84c57107bcb86bcbf3e82e80fc (patch)
tree3cb21abc0fca7550f7a4b6185769a84217e9b0d2 /source3/winbindd
parentda41f23bdad1ea3a1a49110217cfde3efcde5075 (diff)
downloadsamba-36493bf2f6634b84c57107bcb86bcbf3e82e80fc.tar.gz
samba-36493bf2f6634b84c57107bcb86bcbf3e82e80fc.tar.bz2
samba-36493bf2f6634b84c57107bcb86bcbf3e82e80fc.zip
s3: Fix infinite loop in NCACN_IP_TCP asa there is no timeout. Assume lsa_pipe_tcp is ok but network is down, then send request is ok, but select() on writeable fds loops forever since there is no response.
Signed-off-by: Bo Yang <boyang@samba.org>
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_cm.c3
-rw-r--r--source3/winbindd/winbindd_rpc.c10
2 files changed, 4 insertions, 9 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 36b769bf1b..479602a9b4 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -2214,7 +2214,8 @@ NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
if (conn->lsa_pipe_tcp &&
conn->lsa_pipe_tcp->transport->transport == NCACN_IP_TCP &&
- conn->lsa_pipe_tcp->auth->auth_level == DCERPC_AUTH_LEVEL_PRIVACY) {
+ conn->lsa_pipe_tcp->auth->auth_level == DCERPC_AUTH_LEVEL_PRIVACY &&
+ rpc_pipe_tcp_connection_ok(conn->lsa_pipe_tcp)) {
goto done;
}
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index e7003766d8..424f2f3369 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -1286,12 +1286,8 @@ NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
* This call can take a long time
* allow the server to time out.
* 35 seconds should do it.
- * NB
- * only do this when the undelying transport is named pipe.
*/
- if (cli->transport->transport == NCACN_NP) {
- orig_timeout = rpccli_set_timeout(cli, 35000);
- }
+ orig_timeout = rpccli_set_timeout(cli, 35000);
status = lookup_names_fn(cli,
mem_ctx,
@@ -1304,9 +1300,7 @@ NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
types);
/* And restore our original timeout. */
- if (cli->transport->transport == NCACN_NP) {
- rpccli_set_timeout(cli, orig_timeout);
- }
+ rpccli_set_timeout(cli, orig_timeout);
if (!NT_STATUS_IS_OK(status)) {
return status;