We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35228e7 commit d211efdCopy full SHA for d211efd
1 file changed
host/src/vfs/mod.rs
@@ -753,6 +753,11 @@ impl<'a> filesystem::types::HostDescriptor for VfsCtxView<'a> {
753
return Err(FsError::trap(ErrorCode::Invalid));
754
}
755
756
+ if directory && flags.contains(DescriptorFlags::WRITE) {
757
+ // Per POSIX: "O_DIRECTORY: "If path resolves to a non-directory file, fail and set errno to [ENOTDIR]."
758
+ return Err(FsError::trap(ErrorCode::IsDirectory));
759
+ }
760
+
761
// Try to resolve the path to an existing node
762
let existing = self.get_node_from_start(&path, Arc::clone(&base_node));
763
0 commit comments