summaryrefslogtreecommitdiff
path: root/games/bs
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/bs
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/bs')
-rw-r--r--games/bs/bs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/games/bs/bs.c b/games/bs/bs.c
index 68bcdc3a452..188933f5aa8 100644
--- a/games/bs/bs.c
+++ b/games/bs/bs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bs.c,v 1.40 2018/08/05 13:32:25 schwarze Exp $ */
+/* $OpenBSD: bs.c,v 1.41 2018/08/24 11:14:49 mestre Exp $ */
/*
* Copyright (c) 1986, Bruce Holloway
* All rights reserved.
@@ -1341,6 +1341,10 @@ main(int argc, char *argv[])
do_options(argc, argv);
intro();
+
+ if (pledge("stdio tty", NULL) == -1)
+ err(1, "pledge");
+
do {
initgame();
while(awinna() == -1)