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

pledge "stdio rpath wpath cpath tty"

"stdio rpath tty" for game play
"rpath wpath cpath" for maintaining highscores in $USER

ok deraadt@ sthen@
This commit is contained in:
tb 2015-11-20 07:40:23 +00:00
parent e956b09232
commit 8f55f2bb60
3 changed files with 9 additions and 12 deletions

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: tetris.6,v 1.16 2015/07/27 18:48:04 sobrado Exp $
.\" $OpenBSD: tetris.6,v 1.17 2015/11/20 07:40:23 tb Exp $
.\"
.\" Copyright (c) 1992, 1993
.\" The Regents of the University of California. All rights reserved.
@ -32,7 +32,7 @@
.\"
.\" @(#)tetris.6 8.1 (Berkeley) 5/31/93
.\"
.Dd $Mdocdate: July 27 2015 $
.Dd $Mdocdate: November 20 2015 $
.Dt TETRIS 6
.Os
.Sh NAME
@ -146,8 +146,8 @@ Scores which are the highest on a given level
are marked with asterisks
.Dq * .
.Sh FILES
.Bl -tag -width /var/games/tetris.scoresxx
.It Pa /var/games/tetris.scores
.Bl -tag -width $HOME/tetris.scoresxx
.It Pa $HOME/tetris.scores
high score file
.El
.Sh AUTHORS

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tetris.c,v 1.25 2014/11/16 04:49:49 guenther Exp $ */
/* $OpenBSD: tetris.c,v 1.26 2015/11/20 07:40:23 tb Exp $ */
/* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */
/*-
@ -61,7 +61,6 @@ const struct shape *curshape;
const struct shape *nextshape;
long fallrate;
int score;
gid_t gid, egid;
char key_msg[100];
int showpreview, classic;
@ -157,11 +156,10 @@ main(int argc, char *argv[])
const char *errstr;
int ch, i, j;
keys = "jkl pq";
if (pledge("stdio rpath wpath cpath tty", NULL) == -1)
err(1, "pledge");
gid = getgid();
egid = getegid();
setegid(gid);
keys = "jkl pq";
classic = showpreview = 0;
while ((ch = getopt(argc, argv, "ck:l:ps")) != -1)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tetris.h,v 1.10 2008/08/10 12:23:25 krw Exp $ */
/* $OpenBSD: tetris.h,v 1.11 2015/11/20 07:40:23 tb Exp $ */
/* $NetBSD: tetris.h,v 1.2 1995/04/22 07:42:48 cgd Exp $ */
/*-
@ -167,7 +167,6 @@ extern long fallrate; /* less than 1 million; smaller => faster */
#define PRE_PENALTY 0.75
extern int score; /* the obvious thing */
extern gid_t gid, egid;
extern char key_msg[100];
extern int showpreview;