From 01a1998eee184a65133a7eec743e5d75b95887c1 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Fri, 24 Aug 2018 11:14:50 +0000 Subject: 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@ --- games/worm/worm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'games/worm') 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); -- cgit v1.2.3