Bug 3060 - DOS '>' does not truncate the file
Summary: DOS '>' does not truncate the file
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.20
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
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.