mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
Kernel: The superuser is allowed to utime() on any file
Before this patch, root was not able to "touch" someone else's file.
This commit is contained in:
parent
3f74e66e82
commit
889ecd1375
Notes:
sideshowbarker
2024-07-19 10:24:06 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/889ecd13750
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,7 @@ KResult VFS::utime(StringView path, Custody& base, time_t atime, time_t mtime)
|
|||
auto& inode = *descriptor_or_error.value()->inode();
|
||||
if (inode.fs().is_readonly())
|
||||
return KResult(-EROFS);
|
||||
if (inode.metadata().uid != current->process().euid())
|
||||
if (!current->process().is_superuser() && inode.metadata().uid != current->process().euid())
|
||||
return KResult(-EACCES);
|
||||
|
||||
int error = inode.set_atime(atime);
|
||||
|
|
Loading…
Reference in a new issue