strace: Use pledge()

This commit is contained in:
Andreas Kling 2021-01-11 22:36:09 +01:00
commit e5234f9560
Notes: sideshowbarker 2024-07-18 23:55:08 +09:00

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* 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<const char*> child_argv;
const char* output_filename = nullptr;