소스 검색

Kernel: chmod() should allow superuser to change mode bits of any file.

Andreas Kling 6 년 전
부모
커밋
c9d7fc6ec6
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      Kernel/VirtualFileSystem.cpp

+ 1 - 2
Kernel/VirtualFileSystem.cpp

@@ -300,8 +300,7 @@ KResult VFS::chmod(const String& path, mode_t mode, Inode& base)
     if (inode->fs().is_readonly())
     if (inode->fs().is_readonly())
         return KResult(-EROFS);
         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);
         return KResult(-EPERM);
 
 
     // Only change the permission bits.
     // Only change the permission bits.