diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2006-11-27 22:14:24 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2006-11-27 22:14:24 +0300 |
commit | ef26cc9307d61891a657a1e993e477dd4108da5a (patch) | |
tree | f8756732aec49f38d18f4d53e9d4ee863a8e30d9 /winsup | |
parent | f64b151f5905f5a971351cb23c19e7aad9036c0f (diff) |
* fhandler.cc (fhandler_base::open): Fix handling of files with
HIDDEN attribute set.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ca7c93b21..52cb849ab 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2006-11-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Fix handling of files with + HIDDEN attribute set. + 2006-11-27 Christopher Faylor <cgf@timesys.com> * include/cygwin/signal.h: Add __extension__ to various anonymous diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 794b221dc..78c070d14 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -684,6 +684,13 @@ fhandler_base::open (int flags, mode_t mode) if ((c && c[1] == '.') || *get_win32_name () == '.') 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)) + file_attributes |= pc.file_attributes (); + /* If the file should actually be created and ntsec is on, set files attributes. */ if (allow_ntsec && has_acls ()) |