diff options
author | ed <ed@FreeBSD.org> | 2015-08-11 14:08:46 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2015-08-11 14:08:46 +0000 |
commit | c58ce69d7eef5a2a8d95c49f3f3d05029aa38c21 (patch) | |
tree | 4cdb783cf863044ddf871aab274d583cd5e7ecde /sys/compat | |
parent | ce5c81239d547fcb1322f6ca101d5771a9d5a802 (diff) | |
download | FreeBSD-src-c58ce69d7eef5a2a8d95c49f3f3d05029aa38c21.zip FreeBSD-src-c58ce69d7eef5a2a8d95c49f3f3d05029aa38c21.tar.gz |
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.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/cloudabi/cloudabi_file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/compat/cloudabi/cloudabi_file.c b/sys/compat/cloudabi/cloudabi_file.c index 8938252..cdf0585 100644 --- a/sys/compat/cloudabi/cloudabi_file.c +++ b/sys/compat/cloudabi/cloudabi_file.c @@ -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) { |