summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-17 21:15:45 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-18 05:33:10 +0200
commiteb46c7bff380b77b9f59c32a4918ad5b6c326dce (patch)
treeb2f91a2b14a336797089b505f2667222d11b8c40 /source3
parent820915775886a7cfbac1f0c65cbf151d01d82146 (diff)
downloadsamba-eb46c7bff380b77b9f59c32a4918ad5b6c326dce.tar.gz
samba-eb46c7bff380b77b9f59c32a4918ad5b6c326dce.tar.bz2
samba-eb46c7bff380b77b9f59c32a4918ad5b6c326dce.zip
s3:smb2cli: check the response has the SMB2_HDR_FLAG_REDIRECT flag
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/smb2cli_base.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/libsmb/smb2cli_base.c b/source3/libsmb/smb2cli_base.c
index aff59e4212..612ae4aad8 100644
--- a/source3/libsmb/smb2cli_base.c
+++ b/source3/libsmb/smb2cli_base.c
@@ -548,6 +548,7 @@ static void smb2cli_inbuf_received(struct tevent_req *subreq)
struct iovec *cur = &iov[i];
uint8_t *inhdr = (uint8_t *)cur[0].iov_base;
uint16_t opcode = SVAL(inhdr, SMB2_HDR_OPCODE);
+ uint32_t flags = IVAL(inhdr, SMB2_HDR_FLAGS);
uint64_t mid = BVAL(inhdr, SMB2_HDR_MESSAGE_ID);
uint16_t req_opcode;
@@ -576,6 +577,13 @@ static void smb2cli_inbuf_received(struct tevent_req *subreq)
return;
}
+ if (!(flags & SMB2_HDR_FLAG_REDIRECT)) {
+ status = NT_STATUS_INVALID_NETWORK_RESPONSE;
+ smb2cli_notify_pending(cli, status);
+ TALLOC_FREE(frame);
+ return;
+ }
+
smb2cli_req_unset_pending(req);
/*