diff options
author | Jeremy Allison <jra@samba.org> | 2003-10-09 19:01:13 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-10-09 19:01:13 +0000 |
commit | 9216948062123da1c064b9167743a0a9f12d8c98 (patch) | |
tree | eeff1b73e06ec5c506c02bba6e2680a467652d93 | |
parent | 27e8f16188b5db96ae191b2e6ad9948e46d6d9b1 (diff) | |
download | samba-9216948062123da1c064b9167743a0a9f12d8c98.tar.gz |
At least give a message if we're returning a short read for W2K compatibility.
Jeremy.
-rw-r--r-- | source/smbd/reply.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c index 5c1d7915c26..5c9451cf377 100644 --- a/source/smbd/reply.c +++ b/source/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; |