Shell: Use pledge()

This commit is contained in:
Andreas Kling 2020-01-11 20:49:39 +01:00
commit 1934a1ec0b
Notes: sideshowbarker 2024-07-19 10:10:47 +09:00

View file

@ -843,6 +843,11 @@ void save_history()
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
if (pledge("stdio rpath wpath cpath proc exec tty", nullptr) < 0) {
perror("pledge");
return 1;
}
g.uid = getuid(); g.uid = getuid();
g.sid = setsid(); g.sid = setsid();
tcsetpgrp(0, getpgrp()); tcsetpgrp(0, getpgrp());