mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
Kernel: Allow to remove files from sticky directory if user owns it
It's what the Linux chmod(1) manpage says (in the 'Restricted Deletion Flag or Sticky Bit' section), and it just makes sense to me. :^)
This commit is contained in:
parent
798154fbbc
commit
8cfd445c23
Notes:
sideshowbarker
2024-07-17 01:46:00 +09:00
Author: https://github.com/krkk
Commit: 8cfd445c23
Pull-request: https://github.com/SerenityOS/serenity/pull/17006
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
1 changed files with 2 additions and 2 deletions
|
@ -645,7 +645,7 @@ ErrorOr<void> VirtualFileSystem::rename(Credentials const& credentials, Custody&
|
|||
return EACCES;
|
||||
|
||||
if (old_parent_inode.metadata().is_sticky()) {
|
||||
if (!credentials.is_superuser() && old_inode.metadata().uid != credentials.euid())
|
||||
if (!credentials.is_superuser() && old_parent_inode.metadata().uid != credentials.euid() && old_inode.metadata().uid != credentials.euid())
|
||||
return EACCES;
|
||||
}
|
||||
|
||||
|
@ -807,7 +807,7 @@ ErrorOr<void> VirtualFileSystem::unlink(Credentials const& credentials, StringVi
|
|||
return EACCES;
|
||||
|
||||
if (parent_inode.metadata().is_sticky()) {
|
||||
if (!credentials.is_superuser() && inode.metadata().uid != credentials.euid())
|
||||
if (!credentials.is_superuser() && parent_inode.metadata().uid != credentials.euid() && inode.metadata().uid != credentials.euid())
|
||||
return EACCES;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue