From e63cce53aa46890eeb9bc07508a52f904d0bf630 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Thu, 10 Nov 2011 12:57:47 -0500 Subject: [PATCH] [libtirpc] don't drop socket lock in krb5p in 2 other places, we shouldn't have been dropping a socket lock while processing a reply from the server. it lead to race. --- libtirpc/src/clnt_vc.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libtirpc/src/clnt_vc.c b/libtirpc/src/clnt_vc.c index 124207d..d3a339f 100644 --- a/libtirpc/src/clnt_vc.c +++ b/libtirpc/src/clnt_vc.c @@ -625,8 +625,12 @@ call_again: } if (!xdr_getxiddir(xdrs, &ct->reply_msg)) { if (ct->ct_error.re_status == RPC_SUCCESS) { - release_fd_lock(ct->ct_fd, mask); - continue; +#ifdef NO_CB_4_KRB5P + if (cl->cb_thread != INVALID_HANDLE_VALUE) +#endif + release_fd_lock(ct->ct_fd, mask); + SwitchToThread(); + continue; } goto out; } @@ -656,7 +660,10 @@ call_again: goto out; } ct->use_stored_reply_msg = TRUE; - release_fd_lock(ct->ct_fd, mask); +#ifdef NO_CB_4_KRB5P + if (cl->cb_thread != INVALID_HANDLE_VALUE) +#endif + release_fd_lock(ct->ct_fd, mask); SwitchToThread(); } }