Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-02-11 17:27:36 +0300
committerCorinna Vinschen <corinna@vinschen.de>2005-02-11 17:27:36 +0300
commit199bf79367fd838d12900e70c05756f2bc29db5d (patch)
tree79e5de440895ea9b1bfded3253a06c742a8382c8 /winsup
parent3d11bd3e07500ea0a565024c839234b67a4f0f15 (diff)
* times.cc (utimes): Open files with GENERIC_WRITE on file systems
not supporting ACLs.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/times.cc11
2 files changed, 14 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b0e966d62..e70b9402e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * times.cc (utimes): Open files with GENERIC_WRITE on file systems
+ not supporting ACLs.
+
2005-02-09 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Fix checking
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 7ed9e5ec2..e69501225 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -462,8 +462,15 @@ utimes (const char *path, const struct timeval *tvp)
/* MSDN suggests using FILE_FLAG_BACKUP_SEMANTICS for accessing
the times of directories. */
/* Note: It's not documented in MSDN that FILE_WRITE_ATTRIBUTES is
- sufficient to change the timestamps... */
- HANDLE h = CreateFile (win32, FILE_WRITE_ATTRIBUTES,
+ sufficient to change the timestamps, but it is for NTFS and FAT,
+ local or remote, NT and 9x. Unfortunately it's not sufficient
+ for a remote HPFS. Looking for a way to decide whether we
+ should use FILE_WRITE_ATTRIBUTES or GENERIC_WRITE, we're now
+ using the has_acls () attribute. The assumption is, that file
+ systems not supporting ACLs don't have a way to distinguish
+ between GENERIC_WRITE and FILE_WRITE_ATTRIBUTES anyway. */
+ HANDLE h = CreateFile (win32, win32.has_acls () ? FILE_WRITE_ATTRIBUTES
+ : GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
&sec_none_nih, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS,