From 4001b1c3f44c307c9c7f8e38bafc7458b68dc1b2 Mon Sep 17 00:00:00 2001 From: doug Date: Thu, 22 Oct 2015 05:28:42 +0000 Subject: [PATCH] Pledge "stdio rpath tty" for hangman(6). Patch submitted by Ricardo Mestre ok semarie@ --- games/hangman/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/games/hangman/main.c b/games/hangman/main.c index 5e140e736a7..6229ecb559d 100644 --- a/games/hangman/main.c +++ b/games/hangman/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.12 2015/02/07 01:37:30 miod Exp $ */ +/* $OpenBSD: main.c,v 1.13 2015/10/22 05:28:42 doug Exp $ */ /* $NetBSD: main.c,v 1.3 1995/03/23 08:32:50 cgd Exp $ */ /* @@ -43,6 +43,9 @@ main(int argc, char *argv[]) { int ch; + if (pledge("stdio rpath tty", NULL) == -1) + err(1, "pledge"); + while ((ch = getopt(argc, argv, "d:hk")) != -1) { switch (ch) { case 'd': @@ -69,6 +72,10 @@ main(int argc, char *argv[]) } signal(SIGINT, die); setup(); + + if (pledge("stdio tty", NULL) == -1) + err(1, "pledge"); + for (;;) { Wordnum++; playgame(); -- 2.20.1