From ddb799c866128c2429233549756992151774ee2c Mon Sep 17 00:00:00 2001 From: Solene Rapenne Date: Tue, 1 Dec 2020 23:41:55 +0100 Subject: [PATCH] Add ifdef OpenBSD for pledge/unveil, so it should compile on other OSes --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index 91c2afc..19d3a01 100644 --- a/main.c +++ b/main.c @@ -112,11 +112,13 @@ main(int argc, char **argv) if(strlen(path) == 0) strlcpy(path, DEFAULT_CHROOT, sizeof(DEFAULT_CHROOT)); +#ifdef __OpenBSD__ if (unveil(path, "r") == -1) err(1, "unveil"); if (pledge("stdio rpath", NULL) == -1) err(1, "pledge"); +#endif /* * read 1024 chars from stdin