From 1934a1ec0beee6e9472cb336ebc2566de66cd674 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 11 Jan 2020 20:49:39 +0100 Subject: [PATCH] Shell: Use pledge() --- Shell/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Shell/main.cpp b/Shell/main.cpp index 0b98cdb781..c43ceac85a 100644 --- a/Shell/main.cpp +++ b/Shell/main.cpp @@ -843,6 +843,11 @@ void save_history() int main(int argc, char** argv) { + if (pledge("stdio rpath wpath cpath proc exec tty", nullptr) < 0) { + perror("pledge"); + return 1; + } + g.uid = getuid(); g.sid = setsid(); tcsetpgrp(0, getpgrp());