summaryrefslogtreecommitdiff
path: root/games/canfield
diff options
context:
space:
mode:
authorRicardo Mestre <mestre@cvs.openbsd.org>2018-08-24 11:14:50 +0000
committerRicardo Mestre <mestre@cvs.openbsd.org>2018-08-24 11:14:50 +0000
commit01a1998eee184a65133a7eec743e5d75b95887c1 (patch)
treef23bf4555fd5b98ab409ae5f067640a3a2edb5df /games/canfield
parent19bd845b3ff7ec6fa65049c6438c6b05adea281c (diff)
Remove a few too early pledge(2)s on games/ and apply them a little bit later
but with much reduced permissions ("stdio tty" if ncurses based and "stdio" for the ones that only perform basic operations). There's still a few games that we cannot yet remove their fs access, through pledge(2), since they open files on demand and too late, this might get revisited in the future. OK tb@
Diffstat (limited to 'games/canfield')
-rw-r--r--games/canfield/canfield/canfield.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/games/canfield/canfield/canfield.c b/games/canfield/canfield/canfield.c
index 5af1631bf76..df81b14f517 100644
--- a/games/canfield/canfield/canfield.c
+++ b/games/canfield/canfield/canfield.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: canfield.c,v 1.27 2016/09/11 14:21:17 tb Exp $ */
+/* $OpenBSD: canfield.c,v 1.28 2018/08/24 11:14:49 mestre Exp $ */
/* $NetBSD: canfield.c,v 1.7 1995/05/13 07:28:35 jtc Exp $ */
/*
@@ -1732,9 +1732,6 @@ askquit(int dummy)
int
main(int argc, char *argv[])
{
- if (pledge("stdio rpath wpath cpath tty", NULL) == -1)
- err(1, "pledge");
-
signal(SIGINT, askquit);
signal(SIGHUP, cleanup);
signal(SIGTERM, cleanup);
@@ -1743,6 +1740,9 @@ main(int argc, char *argv[])
noecho();
initall();
+ if (pledge("stdio tty", NULL) == -1)
+ err(1, "pledge");
+
instruct();
makeboard();
for (;;) {