mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
Kernel: chmod() should allow superuser to change mode bits of any file.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user