interesting paths: loosen up errno requirements

This commit is contained in:
Pat Hickey
2021-01-25 15:28:01 -08:00
parent b0b263f68e
commit 8f4fecacdc
2 changed files with 19 additions and 16 deletions

View File

@@ -30,11 +30,10 @@ TODOs:
* file_allocate * file_allocate
- call to fd_allocate(10,10) reduces size from 100 to 20 - call to fd_allocate(10,10) reduces size from 100 to 20
* interesting_paths * interesting_paths
- on windows, opening `dir/nested/file/` (line 53) with a trailing slash - on windows, opening a directory with a trailing slash fails
gets you a NOENT instead of a NOTDIR errno.
* nofollow_errors * nofollow_errors
- I loosened up some errno acceptance but still cant delete a symlink to a - I loosened up some errno acceptance but windows requires rmdir to delete
directory a symlink to a directory, rather than unlink_file
* symlink_create * symlink_create
- narrowed down the symlink delete issue that only shows up on linux - narrowed down the symlink delete issue that only shows up on linux
* path_rename * path_rename

View File

@@ -49,21 +49,25 @@ unsafe fn test_interesting_paths(dir_fd: wasi::Fd, arg: &str) {
); );
// Now open it with a trailing slash. // Now open it with a trailing slash.
assert_eq!( let one_trailing_slash_errno = wasi::path_open(dir_fd, 0, "dir/nested/file/", 0, 0, 0, 0)
wasi::path_open(dir_fd, 0, "dir/nested/file/", 0, 0, 0, 0) .expect_err("opening a file with a trailing slash should fail")
.expect_err("opening a file with a trailing slash should fail") .raw_error();
.raw_error(), assert!(
wasi::ERRNO_NOTDIR, one_trailing_slash_errno == wasi::ERRNO_NOTDIR
"errno should be ERRNO_NOTDIR", || one_trailing_slash_errno == wasi::ERRNO_NOENT,
"errno should be ERRNO_NOTDIR or ERRNO_NOENT, got {}",
one_trailing_slash_errno
); );
// Now open it with trailing slashes. // Now open it with trailing slashes.
assert_eq!( let multi_trailing_slash_errno = wasi::path_open(dir_fd, 0, "dir/nested/file///", 0, 0, 0, 0)
wasi::path_open(dir_fd, 0, "dir/nested/file///", 0, 0, 0, 0) .expect_err("opening a file with trailing slashes should fail")
.expect_err("opening a file with trailing slashes should fail") .raw_error();
.raw_error(), assert!(
wasi::ERRNO_NOTDIR, multi_trailing_slash_errno == wasi::ERRNO_NOTDIR
"errno should be ERRNO_NOTDIR", || multi_trailing_slash_errno == wasi::ERRNO_NOENT,
"errno should be ERRNO_NOTDIR or ERRNO_NOENT, got {}",
multi_trailing_slash_errno,
); );
// Now open the directory with a trailing slash. // Now open the directory with a trailing slash.