* times.cc (utimes): Only consider fds opened with write access.

This commit is contained in:
Christopher Faylor 2005-10-19 17:11:25 +00:00
parent 5a90915d41
commit b27f0b2cf9
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,7 @@
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

View File

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