From b452dd13b6d093b29acf0668fd8e91fd18514a74 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 22 Dec 2020 11:33:28 +0100 Subject: [PATCH] Kernel: Allow sys$chmod() to modify the set-gid bit We were incorrectly masking off the set-gid bit. Fixes #4060. --- 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 f8dc1698bf..2aa4663f63 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -487,7 +487,7 @@ KResult VFS::chmod(Custody& custody, mode_t mode) return KResult(-EROFS); // Only change the permission bits. - mode = (inode.mode() & ~04777u) | (mode & 04777u); + mode = (inode.mode() & ~06777u) | (mode & 06777u); return inode.chmod(mode); }