diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-12-08 03:47:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:29:01 -0500 |
commit | c72c3e983468bdee33e4482e7b7ccb45cb7c9ddb (patch) | |
tree | 55557f91f7db9a5b672ead56d030299fcad1fd49 /source4/libcli/raw | |
parent | 2326af7dbd7a273cb1fee04a6a073e33bb68e094 (diff) | |
download | samba-c72c3e983468bdee33e4482e7b7ccb45cb7c9ddb.tar.gz samba-c72c3e983468bdee33e4482e7b7ccb45cb7c9ddb.tar.bz2 samba-c72c3e983468bdee33e4482e7b7ccb45cb7c9ddb.zip |
r20077: support large readx replies, as done by samba3 (and the snia spec),
but not done by windows servers
(This used to be commit e5dbbe177c13b2788b4b4765b3b37cc918b3405c)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/rawreadwrite.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/libcli/raw/rawreadwrite.c b/source4/libcli/raw/rawreadwrite.c index 7a47ce66f4..e7a3209d07 100644 --- a/source4/libcli/raw/rawreadwrite.c +++ b/source4/libcli/raw/rawreadwrite.c @@ -161,6 +161,20 @@ NTSTATUS smb_raw_read_recv(struct smbcli_request *req, union smb_read *parms) parms->readx.out.remaining = SVAL(req->in.vwv, VWV(2)); parms->readx.out.compaction_mode = SVAL(req->in.vwv, VWV(3)); parms->readx.out.nread = SVAL(req->in.vwv, VWV(5)); + + /* handle oversize replies for non-chained readx replies with + CAP_LARGE_READX. The snia spec has must to answer for. */ + if ((req->tree->session->transport->negotiate.capabilities & CAP_LARGE_READX) + && CVAL(req->in.vwv, VWV(0)) == SMB_CHAIN_NONE && + req->in.size >= 0x10000) { + parms->readx.out.nread += (SVAL(req->in.vwv, VWV(7)) << 16); + if (req->in.hdr + SVAL(req->in.vwv, VWV(6)) + + parms->readx.out.nread <= + req->in.buffer + req->in.size) { + req->in.data_size += (SVAL(req->in.vwv, VWV(7)) << 16); + } + } + if (parms->readx.out.nread > MAX(parms->readx.in.mincnt, parms->readx.in.maxcnt) || !smbcli_raw_pull_data(req, req->in.hdr + SVAL(req->in.vwv, VWV(6)), parms->readx.out.nread, |