1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:17:44 +00:00

ps: Use pledge() and unveil()

This commit is contained in:
Andreas Kling 2020-02-18 10:42:04 +01:00
parent 16d5b1d4ca
commit ffb6056675

View file

@ -32,6 +32,23 @@
int main(int argc, char** argv) 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)argc;
(void)argv; (void)argv;