Final part of fix for bug #8679 - recvfile code path using splice() on Linux leaves...
authorJeremy Allison <jra@samba.org>
Sat, 31 Dec 2011 05:19:08 +0000 (21:19 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 4 Jan 2012 20:28:17 +0000 (21:28 +0100)
The code to set a DOS error on short writeX return is amazingly
legacy code, and also breaks the reply as fixup_chain_error_packet()
enforces a 2-byte wct on any reply where smb_rcls != 0.

Found in testing by Andrew Bartlett. Thanks Andrew !

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Dec 31 08:05:35 CET 2011 on sn-devel-104
(cherry picked from commit e39df67669f61056692736db9c8dc16fbf2c3624)

source3/smbd/reply.c

index ac450bb2a925b34bf7fcd75ddf191758516f707d..b86ccd3699b7268f9bc1db1fd227cb5f710388c1 100644 (file)
@@ -4630,11 +4630,6 @@ void reply_write_and_X(struct smb_request *req)
        SSVAL(req->outbuf,smb_vwv2,nwritten);
        SSVAL(req->outbuf,smb_vwv4,nwritten>>16);
 
-       if (nwritten < (ssize_t)numtowrite) {
-               SCVAL(req->outbuf,smb_rcls,ERRHRD);
-               SSVAL(req->outbuf,smb_err,ERRdiskfull);
-       }
-
        DEBUG(3,("writeX fnum=%d num=%d wrote=%d\n",
                fsp->fnum, (int)numtowrite, (int)nwritten));