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
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-10-19 21:11:25 +0400
committerChristopher Faylor <me@cgf.cx>2005-10-19 21:11:25 +0400
commitb27f0b2cf9334dc7e8c60737d9a63fc471db76af (patch)
tree1448c7acdef80f0a436fed489dbc76edba64f14b /winsup/cygwin/times.cc
parent5a90915d415cf179e91e8ee9a73c3640015a64af (diff)
* times.cc (utimes): Only consider fds opened with write access.
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r--winsup/cygwin/times.cc3
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;