summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-07-10 16:37:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:58:19 -0500
commita5b39d1f74cd1b9271fed6017cb0708320339a14 (patch)
tree215d5af39a388122f1e9df376ac200b6d138c6e7
parenta32a7969c598b32c58fad4a7d1cb88cafb4a9e26 (diff)
downloadsamba-a5b39d1f74cd1b9271fed6017cb0708320339a14.tar.gz
samba-a5b39d1f74cd1b9271fed6017cb0708320339a14.tar.bz2
samba-a5b39d1f74cd1b9271fed6017cb0708320339a14.zip
r8290: Fix for bug in SMBwriteBraw where we incorrectly
returned the number of bytes written. Patch from Marcel Müller <mueller@maazl.de>. Jeremy. (This used to be commit 81e7a4a2cfd2d4764d757702f17635e5007e59de)
-rw-r--r--source3/smbd/reply.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index bb583fb94b..5e8c0ef296 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -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);