summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-10 11:02:02 +0200
committerJeremy Allison <jra@samba.org>2011-09-14 12:37:02 -0700
commitf8c26c16b82989e002b839fc9eba6386fc036f6a (patch)
tree4f30c0b2fc79ece16e2ab41ab597c99ec7b883c6 /source3/smbd
parent555c626af83a2dc7bc81f012dd93d73045a3428f (diff)
downloadsamba-f8c26c16b82989e002b839fc9eba6386fc036f6a.tar.gz
samba-f8c26c16b82989e002b839fc9eba6386fc036f6a.tar.bz2
samba-f8c26c16b82989e002b839fc9eba6386fc036f6a.zip
s3:smbd: SMB ReadX with size > 0xffff should only possible for samba clients.
Windows 2008 R2 (and others) ignore the high bits for the read size. Unless we're using the unix extentions and the client uses CIFS_UNIX_LARGE_READ_CAP, we should also ignore the high bits. But we still need to support old "smbclient" binaries and have to check if the client is "Samba". metze Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 6f2f281d63..0adc4e80f6 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -3738,6 +3738,7 @@ nosendfile_read:
void reply_read_and_X(struct smb_request *req)
{
+ struct smbd_server_connection *sconn = req->sconn;
connection_struct *conn = req->conn;
files_struct *fsp;
SMB_OFF_T startpos;
@@ -3776,7 +3777,15 @@ void reply_read_and_X(struct smb_request *req)
return;
}
- if (global_client_caps & CAP_LARGE_READX) {
+ if ((sconn->smb1.unix_info.client_cap_low & CIFS_UNIX_LARGE_READ_CAP) ||
+ (get_remote_arch() == RA_SAMBA)) {
+ /*
+ * This is Samba only behavior (up to Samba 3.6)!
+ *
+ * Windows 2008 R2 ignores the upper_size,
+ * so we do unless unix extentions are active
+ * or "smbclient" is talking to us.
+ */
size_t upper_size = SVAL(req->vwv+7, 0);
smb_maxcnt |= (upper_size<<16);
if (upper_size > 1) {