From 0ecd45eb6bd7318e53221a604fb83d3fc01defa8 Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 1 Dec 2015 07:43:31 +0000 Subject: 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. --- games/backgammon/backgammon/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'games') 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 */ -- cgit v1.2.3