瀏覽代碼

Kernel: Allow sys$chmod() to change the sticky bit

We were incorrectly masking off the sticky bit when setting file modes.
Andreas Kling 4 年之前
父節點
當前提交
b7248be251
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Kernel/FileSystem/VirtualFileSystem.cpp

+ 1 - 1
Kernel/FileSystem/VirtualFileSystem.cpp

@@ -502,7 +502,7 @@ KResult VFS::chmod(Custody& custody, mode_t mode)
         return KResult(-EROFS);
         return KResult(-EROFS);
 
 
     // Only change the permission bits.
     // Only change the permission bits.
-    mode = (inode.mode() & ~06777u) | (mode & 06777u);
+    mode = (inode.mode() & ~07777u) | (mode & 07777u);
     return inode.chmod(mode);
     return inode.chmod(mode);
 }
 }