Skip to content

Commit

Permalink
Userland: Pledge wpath & cpath in strace
Browse files Browse the repository at this point in the history
...while we open the output file.
  • Loading branch information
bugaevc authored and awesomekling committed May 4, 2021
1 parent 7212582 commit 7f98aaa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Userland/Utilities/strace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 7f98aaa

Please sign in to comment.