summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libtrivfs/fsys-getroot.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libtrivfs/fsys-getroot.c b/libtrivfs/fsys-getroot.c
index ed23dd94..6a8a679b 100644
--- a/libtrivfs/fsys-getroot.c
+++ b/libtrivfs/fsys-getroot.c
@@ -58,9 +58,11 @@ trivfs_S_fsys_getroot (struct trivfs_control *cntl,
return err;
}
- if ((flags & (O_READ|O_WRITE|O_EXEC) & trivfs_allow_open)
+ if ((flags & O_WRITE & trivfs_allow_open) != (flags & O_WRITE))
+ return EROFS;
+ if ((flags & (O_READ_WRITE|O_EXEC) & trivfs_allow_open)
!= (flags & (O_READ|O_WRITE|O_EXEC)))
- return EOPNOTSUPP;
+ return EACCES;
/* O_CREAT and O_EXCL are not meaningful here; O_NOLINK and O_NOTRANS
will only be useful when trivfs supports translators (which it doesn't