File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,10 @@ impl FileHandle {
65
65
66
66
#[ inline]
67
67
pub fn is_readable ( & self ) -> bool {
68
- self . flags ( )
69
- . intersects ( OpenFlags :: O_RDONLY | OpenFlags :: O_RDWR )
68
+ // FIXME: switch to Linux ABI for fcntl. mlibc defines O_RDONLY as 0 so, we have to infer
69
+ // the read-only flag.
70
+ let flags = self . flags ( ) ;
71
+ flags. contains ( OpenFlags :: O_RDWR ) || !flags. contains ( OpenFlags :: O_WRONLY )
70
72
}
71
73
72
74
pub fn flags ( & self ) -> OpenFlags {
Original file line number Diff line number Diff line change @@ -1410,7 +1410,7 @@ impl Vm {
1410
1410
}
1411
1411
1412
1412
if !file. is_readable ( ) {
1413
- // return None; // EACCES
1413
+ return None ; // EACCES
1414
1414
}
1415
1415
1416
1416
// TODO: * check if the filsystem is noexec mounted and remove the MAY_EXEC flag.
@@ -1419,7 +1419,7 @@ impl Vm {
1419
1419
1420
1420
( MMapFlags :: MAP_PRIVATE , Some ( file) ) => {
1421
1421
if !file. is_readable ( ) {
1422
- // return None; // EACCES
1422
+ return None ; // EACCES
1423
1423
}
1424
1424
1425
1425
// TODO: * check if the filsystem is noexec mounted and remove the MAY_EXEC flag.
You can’t perform that action at this time.
0 commit comments