Sandbox with pledge(2) on OpenBSD
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[]) {
|
int main(int argc, char *argv[]) {
|
||||||
setlocale(LC_CTYPE, "");
|
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;
|
bool insecure = false;
|
||||||
const char *bind = NULL;
|
const char *bind = NULL;
|
||||||
const char *host = NULL;
|
const char *host = NULL;
|
||||||
|
|
Loading…
Reference in New Issue