From 7f98aaa65a03778cb54b0c85bb5a7df8f7e8eb1f Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 4 May 2021 18:44:04 +0300 Subject: [PATCH] Userland: Pledge wpath & cpath in strace ...while we open the output file. --- Userland/Utilities/strace.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/Utilities/strace.cpp b/Userland/Utilities/strace.cpp index cc0099a889..7bd6e5fdef 100644 --- a/Userland/Utilities/strace.cpp +++ b/Userland/Utilities/strace.cpp @@ -32,7 +32,7 @@ static void handle_sigint(int) int main(int argc, char** argv) { - if (pledge("stdio proc exec ptrace sigaction", nullptr) < 0) { + if (pledge("stdio wpath cpath proc exec ptrace sigaction", nullptr) < 0) { perror("pledge"); return 1; } @@ -60,6 +60,11 @@ int main(int argc, char** argv) trace_file = open_result.value(); } + if (pledge("stdio proc exec ptrace sigaction", nullptr) < 0) { + perror("pledge"); + return 1; + } + int status; if (g_pid == -1) { if (child_argv.is_empty()) {