From e74b6f41cffcb134e77edb75346af3148262401b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 9 Oct 2003 19:01:31 +0000 Subject: At least give a message if we're returning a short read for W2K compatibility. Jeremy. (This used to be commit 84c993d9cd0bc57a8b8b9aa716af1336620e2c87) --- source3/smbd/reply.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source3/smbd') 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; -- cgit