s3: Fix crash in winbindd;(bug#6879).
authorBo Yang <boyang@samba.org>
Fri, 4 Dec 2009 04:53:38 +0000 (12:53 +0800)
committerBo Yang <boyang@samba.org>
Thu, 3 Dec 2009 04:54:19 +0000 (12:54 +0800)
Signed-off-by: Bo Yang <boyang@samba.org>
source3/winbindd/winbindd_rpc.c

index b92637072277b0fe7dafa1bb8ef7a70c23511b31..1018a2952b63fd326c7ce96ece78a31622a29bed 100644 (file)
@@ -1281,8 +1281,12 @@ 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.
         */
-       orig_timeout = rpccli_set_timeout(cli, 35000);
+       if (cli->transport->transport == NCACN_NP) {
+               orig_timeout = rpccli_set_timeout(cli, 35000);
+       }
 
        status = lookup_names_fn(cli,
                                 mem_ctx,
@@ -1295,7 +1299,9 @@ NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
                                 types);
 
        /* And restore our original timeout. */
-       rpccli_set_timeout(cli, orig_timeout);
+       if (cli->transport->transport == NCACN_NP) {
+               rpccli_set_timeout(cli, orig_timeout);
+       }
 
        if (!NT_STATUS_IS_OK(status)) {
                return status;