From f187374c1bb9704f683f79cc21a388024d7521c4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 11 Jan 2020 23:19:30 +0100 Subject: [PATCH] Kernel: fork()ed children should inherit pledge promises :^) Update various places that now need wider promises as they are not reset by fork() anymore. --- Applications/Taskbar/main.cpp | 4 ++-- Applications/Terminal/main.cpp | 4 ++-- Kernel/Process.cpp | 2 ++ Servers/SystemServer/main.cpp | 2 +- Servers/WindowServer/main.cpp | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Applications/Taskbar/main.cpp b/Applications/Taskbar/main.cpp index 5659b1d6fd..c64ba482e9 100644 --- a/Applications/Taskbar/main.cpp +++ b/Applications/Taskbar/main.cpp @@ -5,14 +5,14 @@ int main(int argc, char** argv) { - if (pledge("stdio shared_buffer proc rpath unix cpath fattr", nullptr) < 0) { + if (pledge("stdio shared_buffer proc exec rpath unix cpath fattr", nullptr) < 0) { perror("pledge"); return 1; } GApplication app(argc, argv); - if (pledge("stdio shared_buffer proc rpath unix", nullptr) < 0) { + if (pledge("stdio shared_buffer proc exec rpath unix", nullptr) < 0) { perror("pledge"); return 1; } diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index 82d327bc82..4fdb2fad9d 100644 --- a/Applications/Terminal/main.cpp +++ b/Applications/Terminal/main.cpp @@ -136,7 +136,7 @@ RefPtr create_settings_window(TerminalWidget& terminal, RefPtrm_root_directory = m_root_directory; + child->m_promises = m_promises; + child->m_execpromises = m_execpromises; #ifdef FORK_DEBUG dbgprintf("fork: child=%p\n", child); diff --git a/Servers/SystemServer/main.cpp b/Servers/SystemServer/main.cpp index a5f69a3fe5..a9599486bf 100644 --- a/Servers/SystemServer/main.cpp +++ b/Servers/SystemServer/main.cpp @@ -77,7 +77,7 @@ static void mount_all_filesystems() int main(int, char**) { - if (pledge("stdio proc exec unix rpath cpath chown fattr id", nullptr) < 0) { + if (pledge("stdio proc exec unix rpath wpath cpath chown fattr id", nullptr) < 0) { perror("pledge"); return 1; } diff --git a/Servers/WindowServer/main.cpp b/Servers/WindowServer/main.cpp index d6aa05a635..aeab64d1e7 100644 --- a/Servers/WindowServer/main.cpp +++ b/Servers/WindowServer/main.cpp @@ -10,7 +10,7 @@ int main(int, char**) { - if (pledge("stdio shared_buffer rpath wpath cpath unix proc fattr", nullptr) < 0) { + if (pledge("stdio shared_buffer rpath wpath cpath unix proc exec fattr", nullptr) < 0) { perror("pledge"); return 1; } @@ -35,7 +35,7 @@ int main(int, char**) WSEventLoop loop; - if (pledge("stdio shared_buffer rpath wpath cpath unix proc", nullptr) < 0) { + if (pledge("stdio shared_buffer rpath wpath cpath unix proc exec", nullptr) < 0) { perror("pledge"); return 1; }