summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-07 08:54:40 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-07 09:18:18 +0100
commit597f2ae3423ce70f84e41ed3293f049920fa0758 (patch)
tree1ad4334d7e10d7ca15774d5e95b2342ddac4b305
parentb20775fb3b3c86c4aab913e5cbae19cf4e0e71d3 (diff)
downloadsamba-597f2ae3423ce70f84e41ed3293f049920fa0758.tar.gz
samba-597f2ae3423ce70f84e41ed3293f049920fa0758.tar.bz2
samba-597f2ae3423ce70f84e41ed3293f049920fa0758.zip
s3:libsmb: make sure have_andx_command() returns false for non AndX commands
metze
-rw-r--r--source3/libsmb/async_smb.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 801efe4dd9..26f4b30ce1 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.
@@ -907,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(