Sandbox with pledge(2) on OpenBSD
This commit is contained in:
parent
3b54425ec1
commit
9ea029c580
5
chat.c
5
chat.c
@ -125,6 +125,11 @@ static void signalHandler(int signal) {
|
||||
int main(int argc, char *argv[]) {
|
||||
setlocale(LC_CTYPE, "");
|
||||
|
||||
#ifdef __OpenBSD__
|
||||
int error = pledge("stdio rpath wpath cpath inet dns tty proc exec", NULL);
|
||||
if (error) err(EX_OSERR, "pledge");
|
||||
#endif
|
||||
|
||||
bool insecure = false;
|
||||
const char *bind = NULL;
|
||||
const char *host = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user