summaryrefslogtreecommitdiff
path: root/games/worm
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/worm
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/worm')
-rw-r--r--games/worm/worm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/games/worm/worm.c b/games/worm/worm.c
index 31392105d20..f8a86cf8af3 100644
--- a/games/worm/worm.c
+++ b/games/worm/worm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: worm.c,v 1.38 2016/01/07 16:00:33 tb Exp $ */
+/* $OpenBSD: worm.c,v 1.39 2018/08/24 11:14:49 mestre Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -89,9 +89,6 @@ main(int argc, char **argv)
const char *errstr;
struct timespec t, tn, tdiff;
- if (pledge("stdio rpath tty", NULL) == -1)
- err(1, "pledge");
-
timespecclear(&t);
setvbuf(stdout, outbuf, _IOFBF, sizeof outbuf);
@@ -99,6 +96,10 @@ main(int argc, char **argv)
signal(SIGQUIT, leave);
signal(SIGTSTP, suspend); /* process control signal */
initscr();
+
+ if (pledge("stdio tty", NULL) == -1)
+ err(1, "pledge");
+
cbreak();
noecho();
keypad(stdscr, TRUE);