s4-pvfs: fixed access check failure in SFILEINFO test
authorAndrew Tridgell <tridge@samba.org>
Fri, 27 Nov 2009 03:22:29 +0000 (14:22 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 27 Nov 2009 05:05:06 +0000 (16:05 +1100)
matching windows behaviour is not always the right thing to do!

source4/ntvfs/posix/pvfs_open.c

index b100c856b4916cb400a1b738d726ac479c8d55ee..621db3cf1da9a56bdbb7c23762c50a00facf5c35 100644 (file)
@@ -1941,15 +1941,12 @@ NTSTATUS pvfs_can_update_file_size(struct pvfs_state *pvfs,
                          NTCREATEX_SHARE_ACCESS_WRITE |
                          NTCREATEX_SHARE_ACCESS_DELETE;
        /*
-        * I would have thought that we would need to pass
-        * SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA here too
-        *
-        * But you only need SEC_FILE_WRITE_ATTRIBUTE permissions
-        * to set the filesize.
-        *
-        * --metze
+        * this code previous set only SEC_FILE_WRITE_ATTRIBUTE, with
+        * a comment that this seemed to be wrong, but matched windows
+        * behaviour. It now appears that this windows behaviour is
+        * just a bug.
         */
-       access_mask     = SEC_FILE_WRITE_ATTRIBUTE;
+       access_mask     = SEC_FILE_WRITE_ATTRIBUTE | SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA;
        delete_on_close = false;
        break_to_none   = true;