mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-10 17:12:41 +02:00
Kernel+Tests: Allow deleting someone else's file in my sticky directory
This should be allowed according to Dr. POSIX. :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 03:16:02 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/16f934474f Pull-request: https://github.com/SerenityOS/serenity/pull/16594 Reviewed-by: https://github.com/FalseHonesty Reviewed-by: https://github.com/krkk Reviewed-by: https://github.com/supercomputer7 ✅ Reviewed-by: https://github.com/xZise
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user