diff options
author | Brendan Coles <bcoles@gmail.com> | 2020-11-01 20:45:14 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-02 13:16:09 +0100 |
commit | 328915a27988c223b1eedd722396470377a00845 (patch) | |
tree | 66fb914b373b261efcfcbeb65883457be250a4da | |
parent | 9f8a8e07c2d25009268830c51f58c052a8f6936b (diff) | |
download | serenity-328915a27988c223b1eedd722396470377a00845.zip |
ChessEngine: Use pledge and unveil
-rw-r--r-- | Services/ChessEngine/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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(); } |