Browse Source

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

We were incorrectly masking off the sticky bit when setting file modes.
Andreas Kling 4 years ago
parent
commit
b7248be251
1 changed files with 1 additions and 1 deletions
  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);
 
     // Only change the permission bits.
-    mode = (inode.mode() & ~06777u) | (mode & 06777u);
+    mode = (inode.mode() & ~07777u) | (mode & 07777u);
     return inode.chmod(mode);
 }