mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
s4:smb_server: fix large read_andx requests
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
fd88520497
commit
5a05e687ce
@ -848,6 +848,7 @@ static void reply_read_and_X_send(struct ntvfs_request *ntvfs)
|
||||
void smbsrv_reply_read_and_X(struct smbsrv_request *req)
|
||||
{
|
||||
union smb_read *io;
|
||||
uint16_t high_part = 0;
|
||||
|
||||
/* parse request */
|
||||
if (req->in.wct != 12) {
|
||||
@ -869,13 +870,18 @@ void smbsrv_reply_read_and_X(struct smbsrv_request *req)
|
||||
io->readx.in.read_for_execute = false;
|
||||
}
|
||||
|
||||
if (req->smb_conn->negotiate.client_caps & CAP_LARGE_READX) {
|
||||
uint32_t high_part = IVAL(req->in.vwv, VWV(7));
|
||||
if (high_part == 1) {
|
||||
io->readx.in.maxcnt |= high_part << 16;
|
||||
}
|
||||
if (req->smb_conn->negotiate.protocol == PROTOCOL_NT1) {
|
||||
high_part = SVAL(req->in.vwv, VWV(7));
|
||||
}
|
||||
|
||||
if (high_part != UINT16_MAX) {
|
||||
io->readx.in.maxcnt |= high_part << 16;
|
||||
}
|
||||
|
||||
/*
|
||||
* Windows truncates the length to 0x10000
|
||||
*/
|
||||
io->readx.in.maxcnt = MIN(io->readx.in.maxcnt, 0x10000);
|
||||
|
||||
/* the 64 bit variant */
|
||||
if (req->in.wct == 12) {
|
||||
uint32_t offset_high = IVAL(req->in.vwv, VWV(10));
|
||||
|
Loading…
x
Reference in New Issue
Block a user