mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 09:18:52 +00:00
Kernel: chmod() should allow superuser to change mode bits of any file.
This commit is contained in:
parent
1d2529b4a1
commit
c9d7fc6ec6
Notes:
sideshowbarker
2024-07-19 15:36:56 +09:00
Author: https://github.com/awesomekling
Commit: c9d7fc6ec6
1 changed files with 1 additions and 2 deletions
|
@ -300,8 +300,7 @@ KResult VFS::chmod(const String& path, mode_t mode, Inode& base)
|
|||
if (inode->fs().is_readonly())
|
||||
return KResult(-EROFS);
|
||||
|
||||
// FIXME: Superuser should always be allowed to chmod.
|
||||
if (current->euid() != inode->metadata().uid)
|
||||
if (current->euid() != inode->metadata().uid && !current->is_superuser())
|
||||
return KResult(-EPERM);
|
||||
|
||||
// Only change the permission bits.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue