diff options
author | mestre <mestre@openbsd.org> | 2018-08-24 11:14:49 +0000 |
---|---|---|
committer | mestre <mestre@openbsd.org> | 2018-08-24 11:14:49 +0000 |
commit | b9f129211620eb89b4a66305c6bd4241d9ac028d (patch) | |
tree | aaaaaf7add40a89260ac46525e6e10a3ef3264f0 /games/canfield | |
parent | display CPU_CPUID / machdep.cpuid in hex not decimal (diff) | |
download | wireguard-openbsd-b9f129211620eb89b4a66305c6bd4241d9ac028d.tar.xz wireguard-openbsd-b9f129211620eb89b4a66305c6bd4241d9ac028d.zip |
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.c | 8 |
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 (;;) { |