Add ifdef OpenBSD for pledge/unveil, so it should compile on other OSes
This commit is contained in:
parent
c2d813c0f1
commit
ddb799c866
1 changed files with 2 additions and 0 deletions
2
main.c
2
main.c
|
@ -112,11 +112,13 @@ main(int argc, char **argv)
|
||||||
if(strlen(path) == 0)
|
if(strlen(path) == 0)
|
||||||
strlcpy(path, DEFAULT_CHROOT, sizeof(DEFAULT_CHROOT));
|
strlcpy(path, DEFAULT_CHROOT, sizeof(DEFAULT_CHROOT));
|
||||||
|
|
||||||
|
#ifdef __OpenBSD__
|
||||||
if (unveil(path, "r") == -1)
|
if (unveil(path, "r") == -1)
|
||||||
err(1, "unveil");
|
err(1, "unveil");
|
||||||
|
|
||||||
if (pledge("stdio rpath", NULL) == -1)
|
if (pledge("stdio rpath", NULL) == -1)
|
||||||
err(1, "pledge");
|
err(1, "pledge");
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* read 1024 chars from stdin
|
* read 1024 chars from stdin
|
||||||
|
|
Loading…
Reference in a new issue