From e5234f9560d55d681b61b7b0ab4c3de8c9e8d93a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 11 Jan 2021 22:36:09 +0100 Subject: [PATCH] strace: Use pledge() --- Userland/strace.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/strace.cpp b/Userland/strace.cpp index 3e7f809787..e915e7d3f2 100644 --- a/Userland/strace.cpp +++ b/Userland/strace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Andreas Kling + * Copyright (c) 2018-2021, Andreas Kling * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,6 +53,11 @@ static void handle_sigint(int) int main(int argc, char** argv) { + if (pledge("stdio proc exec ptrace sigaction", nullptr) < 0) { + perror("pledge"); + return 1; + } + Vector child_argv; const char* output_filename = nullptr;