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

Applications: Use pledge and unveil

This commit is contained in:
Brendan Coles 2020-11-02 21:34:29 +00:00 committed by Andreas Kling
parent 9efcb5d290
commit ed5469c1c2
5 changed files with 84 additions and 7 deletions

View file

@ -66,8 +66,29 @@ private:
int main(int argc, char** argv)
{
if (pledge("stdio thread rpath accept cpath wpath shared_buffer unix fattr", nullptr) < 0) {
perror("pledge");
return 1;
}
auto app = GUI::Application::construct(argc, argv);
if (pledge("stdio thread rpath accept shared_buffer", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
}
auto app_icon = GUI::Icon::default_icon("app-theme-editor");
Gfx::Palette preview_palette = app->palette();