The branch, master has been updated via 230cd1e s3:libsmb: return NT_STATUS_OK for if a request is not the last one in the chain via 597f2ae s3:libsmb: make sure have_andx_command() returns false for non AndX commands via b20775f s3:libsmb: remember the seqnum on all chained requests via 20fe765 s3:libsmb: get cmd of the chained request before changing wct_ofs from 384eaba s4: samba-tool user --help documenation improvements Signed-off-by: Theresa Halloran <thall...@linux.vnet.ibm.com>
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 230cd1e276f9661f290b3eaeecca005303a68efb Author: Stefan Metzmacher <me...@samba.org> Date: Mon Nov 7 08:55:20 2011 +0100 s3:libsmb: return NT_STATUS_OK for if a request is not the last one in the chain metze Autobuild-User: Stefan Metzmacher <me...@samba.org> Autobuild-Date: Mon Nov 7 11:38:05 CET 2011 on sn-devel-104 commit 597f2ae3423ce70f84e41ed3293f049920fa0758 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Nov 7 08:54:40 2011 +0100 s3:libsmb: make sure have_andx_command() returns false for non AndX commands metze commit b20775fb3b3c86c4aab913e5cbae19cf4e0e71d3 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Nov 7 08:44:39 2011 +0100 s3:libsmb: remember the seqnum on all chained requests This is needed in order to verify the incoming signature correctly. metze commit 20fe7658a779c24c9a4e0b66da844fd117a97319 Author: Stefan Metzmacher <me...@samba.org> Date: Sat Nov 5 12:29:23 2011 +0100 s3:libsmb: get cmd of the chained request before changing wct_ofs metze ----------------------------------------------------------------------- Summary of changes: source3/libsmb/async_smb.c | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 79194f5..08b6c35 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -51,11 +51,15 @@ static NTSTATUS cli_pull_raw_error(const uint8_t *buf) * @retval Is there a command following? */ -static bool have_andx_command(const char *buf, uint16_t ofs) +static bool have_andx_command(const char *buf, uint16_t ofs, uint8_t cmd) { uint8_t wct; size_t buflen = talloc_get_size(buf); + if (!is_andx_req(cmd)) { + return false; + } + if ((ofs == buflen-1) || (ofs == buflen)) { return false; } @@ -870,7 +874,7 @@ NTSTATUS cli_smb_recv(struct tevent_req *req, } } - if (!have_andx_command((char *)state->inbuf, wct_ofs)) { + if (!have_andx_command((char *)state->inbuf, wct_ofs, cmd)) { /* * This request was not completed because a previous * request in the chain had received an error. @@ -878,6 +882,7 @@ NTSTATUS cli_smb_recv(struct tevent_req *req, return NT_STATUS_REQUEST_ABORTED; } + cmd = CVAL(state->inbuf, wct_ofs + 1); wct_ofs = SVAL(state->inbuf, wct_ofs + 3); /* @@ -889,8 +894,6 @@ NTSTATUS cli_smb_recv(struct tevent_req *req, if (wct_ofs+2 > talloc_get_size(state->inbuf)) { return NT_STATUS_INVALID_NETWORK_RESPONSE; } - - cmd = CVAL(state->inbuf, wct_ofs + 1); } state->cli->raw_status = cli_pull_raw_error(state->inbuf); @@ -908,7 +911,7 @@ NTSTATUS cli_smb_recv(struct tevent_req *req, status = state->cli->raw_status; } - if (!have_andx_command((char *)state->inbuf, wct_ofs)) { + if (!have_andx_command((char *)state->inbuf, wct_ofs, cmd)) { if ((cmd == SMBsesssetupX) && NT_STATUS_EQUAL( @@ -928,6 +931,12 @@ NTSTATUS cli_smb_recv(struct tevent_req *req, */ return status; } + } else { + /* + * Only the last request in the chain get the returned + * status. + */ + status = NT_STATUS_OK; } no_err: @@ -1092,6 +1101,12 @@ NTSTATUS cli_smb_chain_send(struct tevent_req **reqs, int num_reqs) return status; } + for (i=0; i < (num_reqs - 1); i++) { + state = tevent_req_data(reqs[i], struct cli_smb_state); + + state->seqnum = last_state->seqnum; + } + return NT_STATUS_OK; } -- Samba Shared Repository