diff options
author | Andrei Vagin <avagin@google.com> | 2019-09-13 21:43:12 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-09-13 21:44:57 -0700 |
commit | 239a07aabfad8991556b43c85c30270d09353f86 (patch) | |
tree | 00b0eb04c8922adebbc7ecf21d8e6e1ba590a521 /test/syscalls/linux | |
parent | 2bbf73d9ed85bbff81f1e56a6753dfe402682459 (diff) |
gvisor: return ENOTDIR from the unlink syscall
ENOTDIR has to be returned when a component used as a directory in
pathname is not, in fact, a directory.
PiperOrigin-RevId: 269037893
Diffstat (limited to 'test/syscalls/linux')
-rw-r--r-- | test/syscalls/linux/unlink.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/syscalls/linux/unlink.cc b/test/syscalls/linux/unlink.cc index b6f65e027..2040375c9 100644 --- a/test/syscalls/linux/unlink.cc +++ b/test/syscalls/linux/unlink.cc @@ -123,6 +123,8 @@ TEST(UnlinkTest, AtBad) { SyscallSucceeds()); EXPECT_THAT(unlinkat(dirfd, "UnlinkAtFile", AT_REMOVEDIR), SyscallFailsWithErrno(ENOTDIR)); + EXPECT_THAT(unlinkat(dirfd, "UnlinkAtFile/", 0), + SyscallFailsWithErrno(ENOTDIR)); ASSERT_THAT(close(fd), SyscallSucceeds()); EXPECT_THAT(unlinkat(dirfd, "UnlinkAtFile", 0), SyscallSucceeds()); |