From b7248be251d2cf16847ac4f8e98c155e13d796e9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 19 Jan 2021 18:21:43 +0100 Subject: [PATCH] Kernel: Allow sys$chmod() to change the sticky bit We were incorrectly masking off the sticky bit when setting file modes. --- Kernel/FileSystem/VirtualFileSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index 30c3e3009c..06726ee936 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/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); }