s3 setfileinfo: Open with FILE_WRITE_DATA when setting the file size
authorTim Prouty <tprouty@samba.org>
Wed, 25 Nov 2009 00:48:16 +0000 (16:48 -0800)
committerTim Prouty <tprouty@samba.org>
Wed, 25 Nov 2009 16:45:58 +0000 (08:45 -0800)
This matches what is outlined here:
http://msdn.microsoft.com/en-us/library/ms804363.aspx

This is also inline with how winXP/win7 handle this.  See
RAW-SFILEINFO-END-OF-FILE* in smbtorture4.

source3/smbd/trans2.c

index 17ebd81313c137d907ae7b7ceaaa8e0f47019e55..2892e26c772e9b392bf760c3b25bf99053c0f881 100644 (file)
@@ -5578,7 +5578,7 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
                req,                                    /* req */
                0,                                      /* root_dir_fid */
                smb_fname_tmp,                          /* fname */
-               FILE_WRITE_ATTRIBUTES,                  /* access_mask */
+               FILE_WRITE_DATA,                        /* access_mask */
                (FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
                    FILE_SHARE_DELETE),
                FILE_OPEN,                              /* create_disposition*/