diff options
author | tb <tb@cvs.openbsd.org> | 2015-12-01 07:43:31 +0000 |
---|---|---|
committer | tb <tb@cvs.openbsd.org> | 2015-12-01 07:43:31 +0000 |
commit | 0ecd45eb6bd7318e53221a604fb83d3fc01defa8 (patch) | |
tree | 04a4016e1f7137d3fb58bdb27d94aaaee906a67f /games | |
parent | a695cdf4a00af9f10cbbe0e8a1340b8fc7fe238a (diff) |
Make sure "exec" rights are dropped asap in all code paths.
The game also needs "wpath cpath" for supporting the score file,
so add those.
Diffstat (limited to 'games')
-rw-r--r-- | games/backgammon/backgammon/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c index f1742439f25..969d83944b4 100644 --- a/games/backgammon/backgammon/main.c +++ b/games/backgammon/backgammon/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.20 2015/12/01 00:31:46 tb Exp $ */ +/* $OpenBSD: main.c,v 1.21 2015/12/01 07:43:30 tb Exp $ */ /* * Copyright (c) 1980, 1993 @@ -86,7 +86,7 @@ main (int argc, char **argv) int i,l; /* non-descript indices */ char c; /* non-descript character storage */ - if (pledge("stdio rpath tty exec", NULL) == -1) + if (pledge("stdio rpath wpath cpath tty exec", NULL) == -1) err(1, "pledge"); signal(SIGINT, getout); /* trap interrupts */ @@ -109,6 +109,9 @@ main (int argc, char **argv) /* check if restored game and save flag for later */ if ((rfl = rflag)) { + if (pledge("stdio rpath wpath cpath tty", NULL) == -1) + err(1, "pledge"); + wrboard(); /* print board */ /* if new game, pretend to be a non-restored game */ if (cturn == 0) @@ -132,7 +135,7 @@ main (int argc, char **argv) } } - if (pledge("stdio rpath tty", NULL) == -1) + if (pledge("stdio rpath wpath cpath tty", NULL) == -1) err(1, "pledge"); init(); /* initialize board */ |