diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-04-09 13:01:00 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-04-09 13:01:00 +0000 |
commit | d78bda7b75c472de6c4b572df3033fb732057cb6 (patch) | |
tree | 4481df0002d1ceac6733c52872efe69f1d414690 /winsup/cygwin/fhandler.cc | |
parent | c5ef1e95be66c5d1b456fa8518ca3902f9efd581 (diff) | |
download | cygnal-d78bda7b75c472de6c4b572df3033fb732057cb6.tar.gz cygnal-d78bda7b75c472de6c4b572df3033fb732057cb6.tar.bz2 cygnal-d78bda7b75c472de6c4b572df3033fb732057cb6.zip |
* fhandler.cc (fhandler_base::open): Set read-only bit in
file_attributes when adequate.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r-- | winsup/cygwin/fhandler.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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 ()) |