summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-10-09 19:01:13 +0000
committerJeremy Allison <jra@samba.org>2003-10-09 19:01:13 +0000
commitbf2226c217046a1c8b2df2a607d650e31cdfe674 (patch)
tree69d7ddad235865459e605d41bdfc0e6fc820509b /source3/smbd
parent79ae690ff55b5bd41dee0d6f91be614a2c1474a7 (diff)
downloadsamba-bf2226c217046a1c8b2df2a607d650e31cdfe674.tar.gz
samba-bf2226c217046a1c8b2df2a607d650e31cdfe674.tar.bz2
samba-bf2226c217046a1c8b2df2a607d650e31cdfe674.zip
At least give a message if we're returning a short read for W2K compatibility.
Jeremy. (This used to be commit 9216948062123da1c064b9167743a0a9f12d8c98)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 5c1d7915c2..5c9451cf37 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1775,7 +1775,12 @@ int reply_lockread(connection_struct *conn, char *inbuf,char *outbuf, int length
* However the requested READ size IS affected by max_recv. Insanity.... JRA.
*/
- numtoread = MIN(numtoread,max_recv);
+ if (numtoread > max_recv) {
+ DEBUG(0,("reply_lockread: requested read size (%u) is greater than maximum allowed (%u). \
+Returning short read of maximum allowed for compatibility with Windows 2000.\n",
+ (unsigned int)numtoread, (unsigned int)max_recv ));
+ numtoread = MIN(numtoread,max_recv);
+ }
nread = read_file(fsp,data,startpos,numtoread);
if (nread < 0) {
@@ -1820,7 +1825,12 @@ int reply_read(connection_struct *conn, char *inbuf,char *outbuf, int size, int
/*
* The requested read size cannot be greater than max_recv. JRA.
*/
- numtoread = MIN(numtoread,max_recv);
+ if (numtoread > max_recv) {
+ DEBUG(0,("reply_read: requested read size (%u) is greater than maximum allowed (%u). \
+Returning short read of maximum allowed for compatibility with Windows 2000.\n",
+ (unsigned int)numtoread, (unsigned int)max_recv ));
+ numtoread = MIN(numtoread,max_recv);
+ }
data = smb_buf(outbuf) + 3;