diff options
author | Volker Lendecke <vl@samba.org> | 2023-03-01 14:42:00 +0100 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2023-03-07 10:13:09 +0000 |
commit | 743d7600fba554306356a8254f0ca041308fa332 (patch) | |
tree | 651576a24df20e13ab5068d7706cca48aee35962 | |
parent | 32a6eb37fbdc3aa31beb27c81908d20ae9e1e3fd (diff) | |
download | samba-743d7600fba554306356a8254f0ca041308fa332.tar.gz |
rpcd: Do blocking connects to local pipes
We don't have real async callers yet, and this is the simplest way to
fix our missing light-weight deterministic async fallback mechanism.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15310
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 0ab7b84ccbd383bb2f696ce258438d4af57fe6f0)
-rw-r--r-- | source3/rpc_client/local_np.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source3/rpc_client/local_np.c b/source3/rpc_client/local_np.c index 5b1a818c88d..f1d61a09ee3 100644 --- a/source3/rpc_client/local_np.c +++ b/source3/rpc_client/local_np.c @@ -101,7 +101,7 @@ static struct tevent_req *np_sock_connect_send( return tevent_req_post(req, ev); } - ret = set_blocking(state->sock, false); + ret = set_blocking(state->sock, true); if (ret == -1) { tevent_req_error(req, errno); return tevent_req_post(req, ev); @@ -174,6 +174,18 @@ static void np_sock_connect_connected(struct tevent_req *subreq) return; } + /* + * As a quick workaround for bug 15310 we have done the + * connect in blocking mode (see np_sock_connect_send()). The + * rest of our code expects a nonblocking socket, activate + * this after the connect succeeded. + */ + ret = set_blocking(state->sock, false); + if (ret == -1) { + tevent_req_error(req, errno); + return; + } + ret = tstream_bsd_existing_socket( state, state->sock, &state->transport); if (ret == -1) { |