diff options
author | tb <tb@cvs.openbsd.org> | 2015-11-29 14:42:37 +0000 |
---|---|---|
committer | tb <tb@cvs.openbsd.org> | 2015-11-29 14:42:37 +0000 |
commit | 207ae3a0b364479eed19b3aae43ba329b26b1f1a (patch) | |
tree | 4c0dae46d14b8b63b9b832ad9e95995c6115966b /games/cribbage | |
parent | e0c53d6da00872b5a7db6e940abfde247b7f8d9a (diff) |
pledge "stdio rpath tty proc exec" since instructions() might fork a pager.
actual game place takes place with "stdio tty".
OK deraadt@ on an earlier version
Diffstat (limited to 'games/cribbage')
-rw-r--r-- | games/cribbage/crib.c | 9 | ||||
-rw-r--r-- | games/cribbage/instr.c | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c index 377a9cf378f..0c5a7c9ea84 100644 --- a/games/cribbage/crib.c +++ b/games/cribbage/crib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crib.c,v 1.18 2015/03/12 02:19:10 bentley Exp $ */ +/* $OpenBSD: crib.c,v 1.19 2015/11/29 14:42:36 tb Exp $ */ /* $NetBSD: crib.c,v 1.7 1997/07/10 06:47:29 mikel Exp $ */ /*- @@ -49,6 +49,9 @@ main(int argc, char *argv[]) bool playing; int ch; + if(pledge("stdio rpath tty proc exec", NULL) == -1) + err(1, "pledge"); + while ((ch = getopt(argc, argv, "emqr")) != -1) switch (ch) { case 'e': @@ -99,6 +102,10 @@ main(int argc, char *argv[]) msg("For cribbage rules, use \"man cribbage\""); } } + + if (pledge("stdio tty", NULL) == -1) + err(1, "pledge"); + playing = TRUE; do { wclrtobot(Msgwin); diff --git a/games/cribbage/instr.c b/games/cribbage/instr.c index 70deb2bf7be..b2644739b40 100644 --- a/games/cribbage/instr.c +++ b/games/cribbage/instr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: instr.c,v 1.11 2009/10/27 23:59:24 deraadt Exp $ */ +/* $OpenBSD: instr.c,v 1.12 2015/11/29 14:42:36 tb Exp $ */ /* $NetBSD: instr.c,v 1.5 1997/07/10 06:47:30 mikel Exp $ */ /*- @@ -64,7 +64,6 @@ instructions(void) err(1, "vfork"); /* NOTREACHED */ case 0: - setgid(getgid()); if (!isatty(1)) pager = "/bin/cat"; else { |