diff --git a/src/str.c b/src/str.c index 9ed27c2..834d607 100644 --- a/src/str.c +++ b/src/str.c @@ -25,7 +25,7 @@ #include /* EX_OSERR, EX_USAGE */ #ifdef __OpenBSD__ -# include /* pledge(2) */ +# include /* pledge(2), unveil(2) */ #endif char *program_name = "str"; @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) { program_name = argv[0] == NULL ? program_name : argv[0]; #ifdef __OpenBSD__ - if (pledge("stdio", NULL) == -1) { + if (pledge("stdio unveil", NULL) == -1 || unveil(NULL, NULL) == -1) { perror(program_name); return EX_OSERR; }