r8290: Fix for bug in SMBwriteBraw where we incorrectly
authorJeremy Allison <jra@samba.org>
Sun, 10 Jul 2005 16:37:32 +0000 (16:37 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:58:19 +0000 (10:58 -0500)
returned the number of bytes written. Patch from
Marcel Müller <mueller@maazl.de>.
Jeremy.
(This used to be commit 81e7a4a2cfd2d4764d757702f17635e5007e59de)

source3/smbd/reply.c

index bb583fb94b801b873cdb479559c5c3906ba9025c..5e8c0ef296dacab743fa6037d41c4dff853fdc0e 100644 (file)
@@ -2751,7 +2751,6 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size,
        /* Set up outbuf to return the correct return */
        outsize = set_message(outbuf,1,0,True);
        SCVAL(outbuf,smb_com,SMBwritec);
-       SSVAL(outbuf,smb_vwv0,total_written);
 
        if (numtowrite != 0) {
 
@@ -2783,6 +2782,8 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size,
                        total_written += nwritten;
        }
  
+       SSVAL(outbuf,smb_vwv0,total_written);
+
        if ((lp_syncalways(SNUM(conn)) || write_through) && lp_strict_sync(SNUM(conn)))
                sync_file(conn,fsp);