summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-06-05 06:29:57 +0000
committerJeremy Allison <jra@samba.org>2001-06-05 06:29:57 +0000
commit091fd5a1746080b8a988f08557ba5f9df97653a4 (patch)
treed1046daaef94bb7ed936aa87c8bcd3d5a5f2fb2c
parent0326421a6720056047f1d5ae1a3d6eefd693834b (diff)
downloadsamba-091fd5a1746080b8a988f08557ba5f9df97653a4.tar.gz
samba-091fd5a1746080b8a988f08557ba5f9df97653a4.tar.bz2
samba-091fd5a1746080b8a988f08557ba5f9df97653a4.zip
Deal with incorrect large writes from old NT4.x clients.
We still need to set the large write reply correctly. Jeremy. (This used to be commit 810dae29b8b45e91c0c35a4d96202c08b13d4e82)
-rw-r--r--source3/smbd/reply.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 23fedccd88..7cb23d8629 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2668,7 +2668,7 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng
{
files_struct *fsp = file_fsp(inbuf,smb_vwv2);
SMB_OFF_T startpos = IVAL(inbuf,smb_vwv3);
- size_t numtowrite = SVAL(inbuf,smb_vwv10)|(((size_t)SVAL(inbuf,smb_vwv9))<<16);
+ size_t numtowrite = SVAL(inbuf,smb_vwv10);
BOOL write_through = BITSETW(inbuf+smb_vwv7,0);
ssize_t nwritten = -1;
unsigned int smb_doff = SVAL(inbuf,smb_vwv11);
@@ -2686,6 +2686,10 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng
CHECK_WRITE(fsp);
CHECK_ERROR(fsp);
+ /* Deal with possible LARGE_WRITEX */
+ if (smblen > 0xFFFF)
+ numtowrite |= ((((size_t)SVAL(inbuf,smb_vwv9)) & 1 )<<16);
+
if(smb_doff > smblen || (smb_doff + numtowrite > smblen)) {
END_PROFILE(SMBwriteX);
return(ERROR(ERRDOS,ERRbadmem));