diff options
author | Christopher Faylor <me@cgf.cx> | 2005-10-19 17:11:25 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-10-19 17:11:25 +0000 |
commit | b27f0b2cf9334dc7e8c60737d9a63fc471db76af (patch) | |
tree | 1448c7acdef80f0a436fed489dbc76edba64f14b /winsup/cygwin/times.cc | |
parent | 5a90915d415cf179e91e8ee9a73c3640015a64af (diff) | |
download | cygnal-b27f0b2cf9334dc7e8c60737d9a63fc471db76af.tar.gz cygnal-b27f0b2cf9334dc7e8c60737d9a63fc471db76af.tar.bz2 cygnal-b27f0b2cf9334dc7e8c60737d9a63fc471db76af.zip |
* times.cc (utimes): Only consider fds opened with write access.
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r-- | winsup/cygwin/times.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index cc4de9746..e4bcb8cef 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -452,7 +452,8 @@ utimes (const char *path, const struct timeval *tvp) cygheap_fdenum cfd; while (cfd.next () >= 0) - if (strcmp (cfd->get_win32_name (), win32) == 0) + if (cfd->get_access () & (FILE_WRITE_ATTRIBUTES | GENERIC_WRITE) + && strcmp (cfd->get_win32_name (), win32) == 0) { fh = cfd; fromfd = true; |