diff options
author | Jeremy Allison <jra@samba.org> | 2001-06-05 08:17:16 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-06-05 08:17:16 +0000 |
commit | 6d65556ae8bea45a203defaded8436cbb56965e1 (patch) | |
tree | 24f870bfc80e2ab12c3f07a37aa39db201bddb2d /source/smbd/reply.c | |
parent | 810dae29b8b45e91c0c35a4d96202c08b13d4e82 (diff) | |
download | samba-6d65556ae8bea45a203defaded8436cbb56965e1.tar.gz samba-6d65556ae8bea45a203defaded8436cbb56965e1.tar.xz samba-6d65556ae8bea45a203defaded8436cbb56965e1.zip |
Set correct reply word in large writeX (greater than 64k) replies.
Also added smbtorture test for this.
Jeremy.
Diffstat (limited to 'source/smbd/reply.c')
-rw-r--r-- | source/smbd/reply.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c index 7cb23d86297..d3f2527b35d 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -2674,6 +2674,7 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng unsigned int smb_doff = SVAL(inbuf,smb_vwv11); unsigned int smblen = smb_len(inbuf); char *data; + BOOL large_writeX = ((CVAL(inbuf,smb_wct) == 14) && (smblen > 0xFFFF)); START_PROFILE(SMBwriteX); /* If it's an IPC, pass off the pipe handler. */ @@ -2687,7 +2688,7 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng CHECK_ERROR(fsp); /* Deal with possible LARGE_WRITEX */ - if (smblen > 0xFFFF) + if (large_writeX) numtowrite |= ((((size_t)SVAL(inbuf,smb_vwv9)) & 1 )<<16); if(smb_doff > smblen || (smb_doff + numtowrite > smblen)) { @@ -2742,7 +2743,9 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng set_message(outbuf,6,0,True); SSVAL(outbuf,smb_vwv2,nwritten); - + if (large_writeX) + SSVAL(outbuf,smb_vwv4,(nwritten>>16)&1); + if (nwritten < (ssize_t)numtowrite) { CVAL(outbuf,smb_rcls) = ERRHRD; SSVAL(outbuf,smb_err,ERRdiskfull); |