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:
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
parent5a90915d415cf179e91e8ee9a73c3640015a64af (diff)
* times.cc (utimes): Only consider fds opened with write access.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/times.cc3
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 2314db392..27da34378 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2005-10-19 Christopher Faylor <cgf@timesys.com>
+ * times.cc (utimes): Only consider fds opened with write access.
+
+2005-10-19 Christopher Faylor <cgf@timesys.com>
+
* fhandler_disk_file.cc (fhandler_base::utimes_fs): Use existing handle
if fhandler has one.
* times.cc (utimes): Scan open fds for matching paths and use existing
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;