1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +00:00

SystemMenu: Use pledge() and unveil()

This commit is contained in:
Andreas Kling 2020-02-17 20:16:43 +01:00
parent 2060da829c
commit 25b987ce4c

View file

@ -71,6 +71,23 @@ int main(int argc, char** argv)
GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::SetSystemMenu>(menu->menu_id());
if (pledge("stdio shared_buffer accept rpath proc exec", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil("/bin", "x")) {
perror("unveil");
return 1;
}
if (unveil("/res", "r")) {
perror("unveil");
return 1;
}
unveil(nullptr, nullptr);
return app.exec();
}