Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions litebox/src/fs/in_mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,6 @@ impl<Platform: sync::RawSyncPrimitivesProvider> super::backend::Backend for InMe
flags: super::OFlags,
) -> Result<super::backend::DirHandle, OpenError> {
assert_supported_oflags(flags);
if flags.intersects(super::OFlags::WRONLY | super::OFlags::RDWR) {
// TODO(jayb): POSIX requires `EISDIR` when write access is requested on a directory,
// but `OpenError` has no such variant yet.
unimplemented!()
}
Ok(super::backend::DirHandle::from_typed::<Self>(
InMemDirHandle {
flags,
Expand Down
5 changes: 0 additions & 5 deletions litebox/src/fs/nine_p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,6 @@ where
flags: OFlags,
) -> Result<DirHandle, OpenError> {
assert_supported_oflags(flags);
if flags.intersects(OFlags::WRONLY | OFlags::RDWR) {
// TODO(jayb): POSIX requires `EISDIR` when write access is requested on a directory,
// but `OpenError` has no such variant yet.
unimplemented!()
}
let (fid, is_backend_root) = dir.into_typed::<Self>().into_dir();
if flags.contains(OFlags::PATH) {
// An `O_PATH` handle is never opened server-side, so the walked fid can be handed over
Expand Down
20 changes: 18 additions & 2 deletions litebox_shim_linux/src/syscalls/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,26 @@ impl<Platform: ShimPlatform> Task<Platform> {
let files = self.files.borrow();
let fs = self.fs.borrow();
let context = fs.context.read();
files
let file = files
.fs
.open(&context, path, flags - OFlags::CLOEXEC, mode)
.map_err(Errno::from)
.map_err(Errno::from)?;
if flags.intersects(OFlags::WRONLY | OFlags::RDWR)
&& !flags.contains(OFlags::PATH)
&& files
.fs
.fd_file_status(&file)
.map_err(|error| {
files.fs.close(&file).unwrap();
Errno::from(error)
})?
.file_type
== litebox::fs::FileType::Directory
{
files.fs.close(&file).unwrap();
return Err(Errno::EISDIR);
}
Ok(file)
}

fn do_openat(
Expand Down
Loading