From ffb60566750d5560f6c6677d5366f0649f826238 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 18 Feb 2020 10:42:04 +0100 Subject: [PATCH] ps: Use pledge() and unveil() --- Userland/ps.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Userland/ps.cpp b/Userland/ps.cpp index 5ffb8ff20f..068e394ebd 100644 --- a/Userland/ps.cpp +++ b/Userland/ps.cpp @@ -32,6 +32,23 @@ int main(int argc, char** argv) { + if (pledge("stdio rpath", nullptr) < 0) { + perror("pledge"); + return 1; + } + + if (unveil("/proc/all", "r") < 0) { + perror("unveil"); + return 1; + } + + if (unveil("/etc/passwd", "r") < 0) { + perror("unveil"); + return 1; + } + + unveil(nullptr, nullptr); + (void)argc; (void)argv;