forked from cory/tildefriends
Some test fixes, and introduce some pledge and unveil for OpenBSD.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4851 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
15
src/main.c
15
src/main.c
@ -395,6 +395,21 @@ static void _shed_privileges()
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__OpenBSD__)
|
||||
/* How do I unveil nothing? */
|
||||
if (unveil("/dev/null", "r") ||
|
||||
unveil(NULL, NULL))
|
||||
{
|
||||
perror("unveil");
|
||||
exit(-1);
|
||||
}
|
||||
if (pledge("stdio unveil", NULL))
|
||||
{
|
||||
perror("pledge");
|
||||
exit(-1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int _tf_command_run(const char* file, int argc, char* argv[])
|
||||
|
Reference in New Issue
Block a user