summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-23 15:35:20 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-23 16:45:05 +0100
commitc32176db278ccb491475840c46fbdb9fdd21f4ee (patch)
treedce35b83aa87e8f41a543075223f93ad2278af43 /Kernel/Syscalls
parentf2ea6c3d4c32c0a6ed160980bf19219d64ddccab (diff)
downloadserenity-c32176db278ccb491475840c46fbdb9fdd21f4ee.zip
Kernel: Don't preserve set-uid bit in open() and bind() modes
For some reason we were keeping the bits 04777 in file modes. That doesn't seem right and I can't think of a reason why the set-uid bit should be allowed to slip through.
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/open.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/open.cpp b/Kernel/Syscalls/open.cpp
index 8da12548a6..ebbe7f950a 100644
--- a/Kernel/Syscalls/open.cpp
+++ b/Kernel/Syscalls/open.cpp
@@ -57,7 +57,7 @@ int Process::sys$open(Userspace<const Syscall::SC_open_params*> user_params)
REQUIRE_PROMISE(cpath);
// Ignore everything except permission bits.
- mode &= 04777;
+ mode &= 0777;
auto path = get_syscall_path_argument(params.path);
if (path.is_error())