From ca3b92bfaaf9f18b68c84444650df553650a9534 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 28 Apr 2010 15:15:23 +0200 Subject: [PATCH] s3:smbd: add PIPE_BUSY handling for SMBtrans calls on named pipes metze --- source3/smbd/ipc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index 97b338a536e7..08494b4dca66 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -227,12 +227,23 @@ static void api_dcerpc_cmd(connection_struct *conn, struct smb_request *req, { struct tevent_req *subreq; struct dcerpc_cmd_state *state; + bool busy; if (!fsp_is_np(fsp)) { api_no_reply(conn, req); return; } + /* + * Trans requests are only allowed + * if no other Trans or Read is active + */ + busy = np_read_in_progress(fsp->fake_file_handle); + if (busy) { + reply_nterror(req, NT_STATUS_PIPE_BUSY); + return; + } + state = talloc(req, struct dcerpc_cmd_state); if (state == NULL) { reply_nterror(req, NT_STATUS_NO_MEMORY); -- 2.34.1