npc(1): adds null unveil
This commit is contained in:
parent
efedcd3ae4
commit
6166a3ca36
@ -20,7 +20,7 @@
|
|||||||
#include <stdio.h> /* fprintf(3), fputs(3), getc(3), perror(3), putc(3), stdin,
|
#include <stdio.h> /* fprintf(3), fputs(3), getc(3), perror(3), putc(3), stdin,
|
||||||
* stdout, EOF */
|
* stdout, EOF */
|
||||||
#include <sysexits.h> /* EX_IOERR, EX_OK, EX_OSERR, EX_USAGE */
|
#include <sysexits.h> /* EX_IOERR, EX_OK, EX_OSERR, EX_USAGE */
|
||||||
#include <unistd.h> /* pledge(2), getopt(3) */
|
#include <unistd.h> /* NULL, getopt(3), pledge(2), unveil(2) */
|
||||||
|
|
||||||
char *program_name = "npc";
|
char *program_name = "npc";
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
|
|||||||
char showtab = 0; /* prints tab characters in caret notation */
|
char showtab = 0; /* prints tab characters in caret notation */
|
||||||
|
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
if (pledge("stdio", NULL) == -1) {
|
if (pledge("stdio unveil", NULL) == -1 || unveil(NULL, NULL)) {
|
||||||
perror(argv[0] == NULL ? program_name : argv[0]);
|
perror(argv[0] == NULL ? program_name : argv[0]);
|
||||||
return EX_OSERR;
|
return EX_OSERR;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user