path_open: ENOTDIR when fd is a file
This commit is contained in:
@@ -663,7 +663,11 @@ impl<'a> wasi_snapshot_preview1::WasiSnapshotPreview1 for WasiCtx {
|
|||||||
fdflags: types::Fdflags,
|
fdflags: types::Fdflags,
|
||||||
) -> Result<types::Fd, Error> {
|
) -> Result<types::Fd, Error> {
|
||||||
let mut table = self.table();
|
let mut table = self.table();
|
||||||
let dir_entry: Ref<DirEntry> = table.get(u32::from(dirfd))?;
|
let dirfd = u32::from(dirfd);
|
||||||
|
if table.is::<FileEntry>(dirfd) {
|
||||||
|
return Err(Error::Notdir);
|
||||||
|
}
|
||||||
|
let dir_entry: Ref<DirEntry> = table.get(dirfd)?;
|
||||||
|
|
||||||
let symlink_follow = dirflags.contains(&types::Lookupflags::SYMLINK_FOLLOW);
|
let symlink_follow = dirflags.contains(&types::Lookupflags::SYMLINK_FOLLOW);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user