From 24d6814ee56d683fc3089e0a8fb26f2f055ab304 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Tue, 12 Jan 2021 06:41:08 +0000 Subject: [PATCH] CatDog: Add pledge() and lock unveil state --- Demos/CatDog/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Demos/CatDog/main.cpp b/Demos/CatDog/main.cpp index c6408a7d2f..bf7e691615 100644 --- a/Demos/CatDog/main.cpp +++ b/Demos/CatDog/main.cpp @@ -194,6 +194,11 @@ private: int main(int argc, char** argv) { + if (pledge("stdio rpath wpath cpath shared_buffer accept unix fattr", nullptr) < 0) { + perror("pledge"); + return 1; + } + auto app = GUI::Application::construct(argc, argv); auto app_icon = GUI::Icon::default_icon("app-catdog"); @@ -207,6 +212,11 @@ int main(int argc, char** argv) return 1; } + if (unveil(nullptr, nullptr) < 0) { + perror("unveil"); + return 1; + } + auto window = GUI::Window::construct(); window->set_title("CatDog Demo"); window->resize(32, 32);