* fhandler.cc (fhandler_base::open): Fix previous patch to handle the

SYSTEM attribute as well.
This commit is contained in:
Corinna Vinschen 2006-11-28 09:57:01 +00:00
parent 2525dd2eab
commit 902716e599
2 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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,