From 29595817dda54b1dbc5719cae84024b6db4cd41a Mon Sep 17 00:00:00 2001 From: Felix Schumacher Date: Wed, 6 Aug 2008 16:31:22 +0200 Subject: [PATCH] jcifs-1.1.11 from tgz Wed May 4 22:59:32 EDT 2005 jcifs-1.1.11 released If a file is opened with SmbFileOutputStream, written to, and then the client waits for soTimeout without any communication to the target, a subsequent write would zero the contents of the file before the file pointer. This file corruption bug has been fixed. --- README.txt | 8 ++++++++ build.xml | 4 ++-- src/jcifs/smb/SmbFileOutputStream.java | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index dc3683f..e4435f7 100644 --- a/README.txt +++ b/README.txt @@ -1,3 +1,11 @@ +Wed May 4 22:59:32 EDT 2005 +jcifs-1.1.11 released + +If a file is opened with SmbFileOutputStream, written to, and then the +client waits for soTimeout without any communication to the target, a +subsequent write would zero the contents of the file before the file +pointer. This file corruption bug has been fixed. + Sun Apr 17 22:37:04 EDT 2005 jcifs-1.1.10 released diff --git a/build.xml b/build.xml index 1d956ca..f238d3e 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,7 @@ - - + + diff --git a/src/jcifs/smb/SmbFileOutputStream.java b/src/jcifs/smb/SmbFileOutputStream.java index 15b5d90..cb3d658 100644 --- a/src/jcifs/smb/SmbFileOutputStream.java +++ b/src/jcifs/smb/SmbFileOutputStream.java @@ -137,6 +137,7 @@ write, and/or delete the file while the jCIFS user has the file open. new TransWaitNamedPipeResponse() ); } file.open( openFlags, SmbFile.ATTR_NORMAL, 0 ); + this.openFlags &= ~(SmbFile.O_CREAT | SmbFile.O_TRUNC); /* in case close and reopen */ writeSize = file.tree.session.transport.snd_buf_size - 70; useNTSmbs = file.tree.session.transport.hasCapability( ServerMessageBlock.CAP_NT_SMBS ); -- 2.11.0