1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

pledge "stdio rpath tty proc exec" since instructions() might fork a pager.

actual game place takes place with "stdio tty".

OK deraadt@ on an earlier version
This commit is contained in:
tb 2015-11-29 14:42:36 +00:00
parent fa83b6130f
commit 6c53a56d23
2 changed files with 9 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: crib.c,v 1.18 2015/03/12 02:19:10 bentley Exp $ */
/* $OpenBSD: crib.c,v 1.19 2015/11/29 14:42:36 tb Exp $ */
/* $NetBSD: crib.c,v 1.7 1997/07/10 06:47:29 mikel Exp $ */
/*-
@ -49,6 +49,9 @@ main(int argc, char *argv[])
bool playing;
int ch;
if(pledge("stdio rpath tty proc exec", NULL) == -1)
err(1, "pledge");
while ((ch = getopt(argc, argv, "emqr")) != -1)
switch (ch) {
case 'e':
@ -99,6 +102,10 @@ main(int argc, char *argv[])
msg("For cribbage rules, use \"man cribbage\"");
}
}
if (pledge("stdio tty", NULL) == -1)
err(1, "pledge");
playing = TRUE;
do {
wclrtobot(Msgwin);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: instr.c,v 1.11 2009/10/27 23:59:24 deraadt Exp $ */
/* $OpenBSD: instr.c,v 1.12 2015/11/29 14:42:36 tb Exp $ */
/* $NetBSD: instr.c,v 1.5 1997/07/10 06:47:30 mikel Exp $ */
/*-
@ -64,7 +64,6 @@ instructions(void)
err(1, "vfork");
/* NOTREACHED */
case 0:
setgid(getgid());
if (!isatty(1))
pager = "/bin/cat";
else {