From 19151511162744a4b473f610e8efb7f7dc88e400 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 12 Jan 2020 16:32:01 -0800 Subject: [PATCH] man: Use pledge() --- Userland/man.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Userland/man.cpp b/Userland/man.cpp index 8278cd2cc3a..185be2abe03 100644 --- a/Userland/man.cpp +++ b/Userland/man.cpp @@ -6,6 +6,11 @@ int main(int argc, char* argv[]) { + if (pledge("stdio rpath", nullptr) < 0) { + perror("pledge"); + return 1; + } + String name; String section; @@ -55,6 +60,12 @@ int main(int argc, char* argv[]) perror("Failed to open man page file"); exit(1); } + + if (pledge("stdio", nullptr) < 0) { + perror("pledge"); + return 1; + } + dbg() << "Loading man page from " << file->filename(); auto buffer = file->read_all(); String source { (const char*)buffer.data(), (size_t)buffer.size() };