diff options
author | Ricardo Mestre <mestre@cvs.openbsd.org> | 2018-08-24 11:14:50 +0000 |
---|---|---|
committer | Ricardo Mestre <mestre@cvs.openbsd.org> | 2018-08-24 11:14:50 +0000 |
commit | 01a1998eee184a65133a7eec743e5d75b95887c1 (patch) | |
tree | f23bf4555fd5b98ab409ae5f067640a3a2edb5df /games/snake | |
parent | 19bd845b3ff7ec6fa65049c6438c6b05adea281c (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/snake')
-rw-r--r-- | games/snake/snake.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/games/snake/snake.c b/games/snake/snake.c index 780c5816fff..a0c8aac71c9 100644 --- a/games/snake/snake.c +++ b/games/snake/snake.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snake.c,v 1.28 2016/09/11 14:21:18 tb Exp $ */ +/* $OpenBSD: snake.c,v 1.29 2018/08/24 11:14:49 mestre Exp $ */ /* $NetBSD: snake.c,v 1.8 1995/04/29 00:06:41 mycroft Exp $ */ /* @@ -140,9 +140,6 @@ main(int argc, char *argv[]) struct sigaction sa; int ch, i; - if (pledge("stdio rpath wpath cpath tty", NULL) == -1) - err(1, "pledge"); - #ifdef LOGGING const char *home; @@ -182,6 +179,10 @@ main(int argc, char *argv[]) readscores(1); penalty = loot = 0; initscr(); + + if (pledge("stdio tty", NULL) == -1) + err(1, "pledge"); + #ifdef KEY_LEFT keypad(stdscr, TRUE); #endif |