mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00: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:
parent
47b9e8e651
commit
16f934474f
Notes:
sideshowbarker
2024-07-17 03:16:02 +09:00
Author: https://github.com/awesomekling
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
2 changed files with 50 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue