summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-11-28 09:57:01 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-11-28 09:57:01 +0000
commit902716e5992bba1fdab08550e8fa70f6cbfa838b (patch)
treeb2597403109d966b7ee9a23704413bd74736324d /winsup/cygwin
parent2525dd2eabea8e872e2fba42610c1437826cad22 (diff)
downloadcygnal-902716e5992bba1fdab08550e8fa70f6cbfa838b.tar.gz
cygnal-902716e5992bba1fdab08550e8fa70f6cbfa838b.tar.bz2
cygnal-902716e5992bba1fdab08550e8fa70f6cbfa838b.zip
* fhandler.cc (fhandler_base::open): Fix previous patch to handle the
SYSTEM attribute as well.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler.cc9
2 files changed, 10 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 52cb849ab..3a7328c30 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.cc (fhandler_base::open): Fix previous patch to handle the
+ SYSTEM attribute as well.
+
2006-11-27 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::open): Fix handling of files with
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 78c070d14..0fc9e6fcc 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -685,10 +685,11 @@ fhandler_base::open (int flags, mode_t mode)
file_attributes |= FILE_ATTRIBUTE_HIDDEN;
#endif
/* Starting with Windows 2000, when trying to overwrite an already
- existing file with FILE_ATTRIBUTE_HIDDEN attribute set, CreateFile
- fails with "Permission denied". Per MSDN you have to create the
- file with the same attributes as already specified for the file. */
- if (exists () && has_attribute (FILE_ATTRIBUTE_HIDDEN))
+ existing file with FILE_ATTRIBUTE_HIDDEN and/or FILE_ATTRIBUTE_SYSTEM
+ attribute set, CreateFile fails with ERROR_ACCESS_DENIED.
+ Per MSDN you have to create the file with the same attributes as
+ already specified for the file. */
+ if (has_attribute (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM))
file_attributes |= pc.file_attributes ();
/* If the file should actually be created and ntsec is on,