From 328915a27988c223b1eedd722396470377a00845 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Sun, 1 Nov 2020 20:45:14 +0000 Subject: [PATCH] ChessEngine: Use pledge and unveil --- Services/ChessEngine/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Services/ChessEngine/main.cpp b/Services/ChessEngine/main.cpp index 185b6f065c..690c7417d5 100644 --- a/Services/ChessEngine/main.cpp +++ b/Services/ChessEngine/main.cpp @@ -30,7 +30,20 @@ int main() { + if (pledge("stdio shared_buffer accept unix rpath cpath fattr", nullptr) < 0) { + perror("pledge"); + return 1; + } Core::EventLoop loop; + if (pledge("stdio shared_buffer unix", nullptr) < 0) { + perror("pledge"); + return 1; + } + if (unveil(nullptr, nullptr) < 0) { + perror("unveil"); + return 1; + } + auto engine = ChessEngine::construct(Core::File::stdin(), Core::File::stdout()); return loop.exec(); }