mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fall back to O_RDONLY -- not O_WRONLY.
If CloudABI processes open files with a set of requested rights that do not match any of the privileges granted by O_RDONLY, O_WRONLY or O_RDWR, we'd better fall back to O_RDONLY -- not O_WRONLY.
This commit is contained in:
parent
9d9123a80d
commit
55a224afa2
1 changed files with 1 additions and 1 deletions
|
|
@ -224,7 +224,7 @@ cloudabi_sys_file_open(struct thread *td,
|
|||
write = (fds.fs_rights_base & (CLOUDABI_RIGHT_FD_DATASYNC |
|
||||
CLOUDABI_RIGHT_FD_WRITE | CLOUDABI_RIGHT_FILE_ALLOCATE |
|
||||
CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE)) != 0;
|
||||
fflags = read ? write ? FREAD | FWRITE : FREAD : FWRITE;
|
||||
fflags = write ? read ? FREAD | FWRITE : FWRITE : FREAD;
|
||||
|
||||
/* Convert open flags. */
|
||||
if ((uap->oflags & CLOUDABI_O_CREAT) != 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue