This is the mail archive of the
cygwin
mailing list for the Cygwin project.
[1.7] Admins can write to readonly files
- From: "Christian Franke" <Christian dot Franke at t-online dot de>
- To: "Cygwin" <cygwin at cygwin dot com>
- Date: Fri, 28 Aug 2009 12:06:24 +0200
- Subject: [1.7] Admins can write to readonly files
- Reply-to: "Christian Franke" <Christian dot Franke at t-online dot de>
For members of Admin group, Cygwin 1.7 allows to overwrite files without
write permission, but Cygwin 1.5 does not.
Is this a intended change of 1.7 ?
I would suggest to add a note to
http://cygwin.com/1.7/cygwin-ug-net/ov-new1.7.html
Testcase (WinXP SP2 and 3, Cygwin 1.7.0-60):
$ touch foo
$ chmod a=r foo
$ ls -l foo
-r--r--r-- 1 franke none 0 Aug 28 11:17 foo
$ cacls foo | grep FILE_WRITE_DATA
$ attrib foo
A C:\cygwin\tmp\foo
$ dd if=/dev/zero bs=1 count=1 of=foo
1+0 records in
1+0 records out
1 byte (1 B) copied, 0 s, Infinity B/s
Same file, but Cygwin 1.5:
$ dd if=/dev/zero bs=1 count=1 of=foo
dd: opening `foo': Permission denied
fhandler_base::open() calls NtCreateFile() with different
'creation_options' values:
1.5.0-25:
0x0420 = FILE_OPEN_FOR_RECOVERY|FILE_SYNCHRONOUS_IO_NONALERT
1.7.0-60:
0x4020 = FILE_OPEN_FOR_BACKUP_INTENT|FILE_SYNCHRONOUS_IO_NONALERT
What is the effect of FILE_OPEN_FOR_RECOVERY ?
--
Regards
Christian Franke
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple