Date: Tue, 11 Aug 2015 14:08:47 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286633 - head/sys/compat/cloudabi Message-ID: <201508111408.t7BE8lg8059839@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Tue Aug 11 14:08:46 2015 New Revision: 286633 URL: https://svnweb.freebsd.org/changeset/base/286633 Log: 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. Modified: head/sys/compat/cloudabi/cloudabi_file.c Modified: head/sys/compat/cloudabi/cloudabi_file.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_file.c Tue Aug 11 14:07:04 2015 (r286632) +++ head/sys/compat/cloudabi/cloudabi_file.c Tue Aug 11 14:08:46 2015 (r286633) @@ -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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508111408.t7BE8lg8059839>