diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-18 10:42:04 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-18 11:35:47 +0100 |
commit | ffb60566750d5560f6c6677d5366f0649f826238 (patch) | |
tree | a50369427436b5ddd206d7d71306bf5a43aa4c97 /Userland/ps.cpp | |
parent | 16d5b1d4ca8e54c28c85ab39c08461dbda0f8848 (diff) | |
download | serenity-ffb60566750d5560f6c6677d5366f0649f826238.zip |
ps: Use pledge() and unveil()
Diffstat (limited to 'Userland/ps.cpp')
-rw-r--r-- | Userland/ps.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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; |