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>2002-04-09 17:01:00 +0400
committerCorinna Vinschen <corinna@vinschen.de>2002-04-09 17:01:00 +0400
commitd78bda7b75c472de6c4b572df3033fb732057cb6 (patch)
tree4481df0002d1ceac6733c52872efe69f1d414690 /winsup
parentc5ef1e95be66c5d1b456fa8518ca3902f9efd581 (diff)
* fhandler.cc (fhandler_base::open): Set read-only bit in
file_attributes when adequate.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog17
-rw-r--r--winsup/cygwin/fhandler.cc4
2 files changed, 15 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4d3a0b867..5c87b47dd 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.cc (fhandler_base::open): Set read-only bit in
+ file_attributes when adequate.
+
2002-03-28 Christopher Faylor <cgf@redhat.com>
* times.cc (gettimeofday): Fix typo in previous patch.
@@ -37,7 +42,7 @@
(winpids::add): Use PID_ALLPIDS when looking for all pids.
* cygwin.h (PID_ALLPIDS): New enum element.
-2002-03-15 Corinna Vinschen <corina@vinschen.de>
+2002-03-15 Corinna Vinschen <corinna@vinschen.de>
* glob.c (stat32_to_STAT): New function.
(g_lstat): Call user space functions always with 32 bit struct stat
@@ -56,23 +61,23 @@
* poll.cc (poll): Remove variable open_fds. Rearrange and add code to
fix settings of revents.
-2002-03-13 Corinna Vinschen <corina@vinschen.de>
+2002-03-13 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (mmap_record::map_map): Return -1 if VirtualProtect fails.
(list::erase): New method with no argument. Erase latest record
added.
(mmap64): Fail if map_map() fails.
-2002-03-12 Corinna Vinschen <corina@vinschen.de>
+2002-03-12 Corinna Vinschen <corinna@vinschen.de>
* sysconf.cc (sysconf): Fix condition.
-2002-03-11 Corinna Vinschen <corina@vinschen.de>
+2002-03-11 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (msync): Check area given by addr and len for being a
contigeous mmap'd region.
-2002-03-11 Corinna Vinschen <corina@vinschen.de>
+2002-03-11 Corinna Vinschen <corinna@vinschen.de>
* fork.cc (fork_child): Call fixup_mmaps_after_fork() before
closing parent process handle. Call fixup_mmaps_after_fork()
@@ -82,7 +87,7 @@
In case of FILE_MAP_COPY access, copy valid memory regions to child.
* pinfo.h (fixup_mmaps_after_fork): Change prototype accordingly.
-2002-03-07 Corinna Vinschen <corina@vinschen.de>
+2002-03-07 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (NetGetDCName): Add symbol.
(NetServerEnum): Remove symbol.
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index cb74ffa28..abddc6000 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -393,6 +393,10 @@ fhandler_base::open (path_conv *, int flags, mode_t mode)
goto done;
}
+ /* If mode has no write bits set, we set the R/O attribute. */
+ if (!(mode & (S_IWUSR | S_IWGRP | S_IWOTH)))
+ file_attributes |= FILE_ATTRIBUTE_READONLY;
+
/* If the file should actually be created and ntsec is on,
set files attributes. */
if (flags & O_CREAT && get_device () == FH_DISK && allow_ntsec && has_acls ())