mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
Inspector: Use pledge() and unveil()
This commit is contained in:
parent
dc039fdc7e
commit
af29dff224
1 changed files with 23 additions and 0 deletions
|
@ -45,6 +45,23 @@
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
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)
|
if (argc != 2)
|
||||||
print_usage_and_exit();
|
print_usage_and_exit();
|
||||||
|
|
||||||
|
@ -91,5 +108,11 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
window->show();
|
window->show();
|
||||||
remote_process.update();
|
remote_process.update();
|
||||||
|
|
||||||
|
if (pledge("stdio shared_buffer rpath accept unix", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue