From 41982c2f736b8f8ffb3df924566849b7514ba23c Mon Sep 17 00:00:00 2001 From: emma Date: Wed, 28 Aug 2024 00:30:45 -0600 Subject: [PATCH] str(1): adds null unveil --- src/str.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }