* fhandler.cc (fhandler_base::open): Set read-only bit in

file_attributes when adequate.
This commit is contained in:
Corinna Vinschen
2002-04-09 13:01:00 +00:00
parent c5ef1e95be
commit d78bda7b75
2 changed files with 15 additions and 6 deletions

View File

@ -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 ())