diff --git a/src/peek.c b/src/peek.c index f9fb6f8..95fcf80 100644 --- a/src/peek.c +++ b/src/peek.c @@ -22,7 +22,8 @@ #include /* exit(3), EXIT_FAILURE */ #include /* EX_IOERR, EX_OK, EX_USAGE */ #include /* tcgetattr(3), tcsetattr(3), struct termios, ECHO */ -#include /* getopt(3), isatty(3), STDIN_FILENO */ +#include /* getopt(3), isatty(3), pledge(2), unveil(2), + * STDIN_FILENO */ char *program_name = "peek"; @@ -60,6 +61,11 @@ usage(char *argv0) { } int main(int argc, char *argv[]){ +#ifdef __OpenBSD__ + pledge("stdio tty unveil", NULL); + unveil(NULL, NULL); +#endif + if (argc > 0) { /* option parsing */ char allow_nonterminals; int c;