Bug 3060 - DOS '>' does not truncate the file
DOS '>' does not truncate the file
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.20
x86 Linux
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-02 01:10 UTC by Leo Weppelman
Modified: 2005-09-09 17:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Weppelman 2005-09-02 01:10:49 UTC
From the dos commandline (assuming you are on an smb mounted directory):
  # echo 12345678990 > testfile
  # echo 1234 > testfile
  # type testfile

You now notice that testfile is _not_ containing '1234' as expected.

Systems used:
  - PCclient on PC-DOS 6.2
  - Server: Sarge stable with self compiled samba-3.0.20rc2 still
            running a 2.4.20-686 woody kernel.


The patch:
Index: source/smbd/reply.c
===================================================================
--- source/smbd/reply.c.orig
+++ source/smbd/reply.c
@@ -1610,7 +1610,7 @@
                create_disposition = FILE_CREATE;
        } else {
                /* Create if file doesn't exist, truncate if it does. */
-               create_disposition = FILE_OPEN_IF;
+               create_disposition = FILE_OVERWRITE_IF;
        }

        /* Open file using ntcreate. */
Comment 1 Jeremy Allison 2005-09-09 17:45:33 UTC
Completely correct - applied, thanks !
Jeremy.