diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-06 09:23:07 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-06 09:23:07 +0100 |
commit | af29dff2244db68a81e2f4812e8b92e95b31b181 (patch) | |
tree | bfda423950a14d1c4ef4e75654fa922711c43e1d /DevTools/Inspector/main.cpp | |
parent | dc039fdc7ef2ec23cfde4a91eb81d07579c230c9 (diff) | |
download | serenity-af29dff2244db68a81e2f4812e8b92e95b31b181.zip |
Inspector: Use pledge() and unveil()
Diffstat (limited to 'DevTools/Inspector/main.cpp')
-rw-r--r-- | DevTools/Inspector/main.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/DevTools/Inspector/main.cpp b/DevTools/Inspector/main.cpp index 1b4e583293..ee417b4580 100644 --- a/DevTools/Inspector/main.cpp +++ b/DevTools/Inspector/main.cpp @@ -45,6 +45,23 @@ int main(int argc, char** argv) { + if (pledge("stdio shared_buffer rpath accept unix cpath fattr", nullptr) < 0) { + perror("pledge"); + return 1; + } + + if (unveil("/res", "r") < 0) { + perror("unveil"); + return 1; + } + + if (unveil("/tmp", "rwc") < 0) { + perror("unveil"); + return 1; + } + + unveil(nullptr, nullptr); + if (argc != 2) print_usage_and_exit(); @@ -91,5 +108,11 @@ int main(int argc, char** argv) window->show(); remote_process.update(); + + if (pledge("stdio shared_buffer rpath accept unix", nullptr) < 0) { + perror("pledge"); + return 1; + } + return app.exec(); } |