summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/VirtualFileSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/FileSystem/VirtualFileSystem.cpp')
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp
index fe0b827db2..98621c85ec 100644
--- a/Kernel/FileSystem/VirtualFileSystem.cpp
+++ b/Kernel/FileSystem/VirtualFileSystem.cpp
@@ -868,8 +868,13 @@ ErrorOr<void> VirtualFileSystem::rmdir(Credentials const& credentials, StringVie
return EACCES;
if (parent_metadata.is_sticky()) {
- if (!credentials.is_superuser() && inode.metadata().uid != credentials.euid())
+ // [EACCES] The S_ISVTX flag is set on the directory containing the file referred to by the path argument
+ // and the process does not satisfy the criteria specified in XBD Directory Protection.
+ if (!credentials.is_superuser()
+ && inode.metadata().uid != credentials.euid()
+ && parent_metadata.uid != credentials.euid()) {
return EACCES;
+ }
}
size_t child_count = 0;