mirror of
https://github.com/openbsd/src.git
synced 2025-01-10 06:47:55 -08:00
Pledge "stdio" for simple games.
ok semarie@
This commit is contained in:
parent
0c6814e18c
commit
673e924c36
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: banner.c,v 1.17 2015/02/10 13:50:58 tedu Exp $ */
|
||||
/* $OpenBSD: banner.c,v 1.18 2015/10/14 08:12:12 doug Exp $ */
|
||||
/* $NetBSD: banner.c,v 1.4 1995/04/22 11:55:15 cgd Exp $ */
|
||||
|
||||
/*
|
||||
@ -1017,6 +1017,9 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int ch;
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
while ((ch = getopt(argc, argv, "w:tdh")) != -1)
|
||||
switch (ch) {
|
||||
case 'd':
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: bcd.c,v 1.20 2014/11/07 22:17:49 schwarze Exp $ */
|
||||
/* $OpenBSD: bcd.c,v 1.21 2015/10/14 08:12:12 doug Exp $ */
|
||||
/* $NetBSD: bcd.c,v 1.6 1995/04/24 12:22:23 cgd Exp $ */
|
||||
|
||||
/*
|
||||
@ -124,6 +124,9 @@ main(int argc, char *argv[])
|
||||
int dflag = 0;
|
||||
int ch;
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
while ((ch = getopt(argc, argv, "dl")) != -1) {
|
||||
switch (ch) {
|
||||
case 'd':
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: caesar.c,v 1.16 2014/07/03 20:30:17 schwarze Exp $ */
|
||||
/* $OpenBSD: caesar.c,v 1.17 2015/10/14 08:12:12 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -73,6 +73,9 @@ main(int argc, char *argv[])
|
||||
int obs[26], try, winner;
|
||||
double dot, winnerdot;
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
/* check to see if we were called as rot13 */
|
||||
av = argv;
|
||||
p = strrchr(*av, '/');
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: factor.c,v 1.20 2015/09/07 00:49:20 tedu Exp $ */
|
||||
/* $OpenBSD: factor.c,v 1.21 2015/10/14 08:12:12 doug Exp $ */
|
||||
/* $NetBSD: factor.c,v 1.5 1995/03/23 08:28:07 cgd Exp $ */
|
||||
|
||||
/*
|
||||
@ -87,6 +87,9 @@ main(int argc, char *argv[])
|
||||
int ch;
|
||||
char *p, buf[100]; /* > max number of digits. */
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
while ((ch = getopt(argc, argv, "")) != -1) {
|
||||
switch (ch) {
|
||||
case '?':
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: morse.c,v 1.15 2013/11/27 13:32:02 okan Exp $ */
|
||||
/* $OpenBSD: morse.c,v 1.16 2015/10/14 08:12:12 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -112,6 +112,9 @@ main(int argc, char *argv[])
|
||||
int ch;
|
||||
char *p;
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
while ((ch = getopt(argc, argv, "dsh")) != -1)
|
||||
switch(ch) {
|
||||
case 'd':
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: number.c,v 1.14 2009/10/27 23:59:26 deraadt Exp $ */
|
||||
/* $OpenBSD: number.c,v 1.15 2015/10/14 08:12:12 doug Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1993, 1994
|
||||
@ -79,6 +79,9 @@ main(int argc, char *argv[])
|
||||
int ch, first;
|
||||
char line[LINELEN];
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
lflag = 0;
|
||||
while ((ch = getopt(argc, argv, "hl")) != -1)
|
||||
switch (ch) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: pig.c,v 1.11 2009/10/27 23:59:26 deraadt Exp $ */
|
||||
/* $OpenBSD: pig.c,v 1.12 2015/10/14 08:12:12 doug Exp $ */
|
||||
/* $NetBSD: pig.c,v 1.2 1995/03/23 08:41:40 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
@ -49,6 +49,9 @@ main(int argc, char *argv[])
|
||||
int ch;
|
||||
char buf[1024];
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
while ((ch = getopt(argc, argv, "")) != -1)
|
||||
switch(ch) {
|
||||
case '?':
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: pom.c,v 1.16 2015/03/17 19:31:30 millert Exp $ */
|
||||
/* $OpenBSD: pom.c,v 1.17 2015/10/14 08:12:12 doug Exp $ */
|
||||
/* $NetBSD: pom.c,v 1.6 1996/02/06 22:47:29 jtc Exp $ */
|
||||
|
||||
/*
|
||||
@ -85,6 +85,9 @@ main(int argc, char *argv[])
|
||||
int cnt;
|
||||
char buf[1024];
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
if (argc > 1) {
|
||||
tmpt = parsetime(argv[1]);
|
||||
strftime(buf, sizeof(buf), "%a %Y %b %e %H:%M:%S (%Z)",
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ppt.c,v 1.12 2014/11/07 22:17:49 schwarze Exp $ */
|
||||
/* $OpenBSD: ppt.c,v 1.13 2015/10/14 08:12:12 doug Exp $ */
|
||||
/* $NetBSD: ppt.c,v 1.4 1995/03/23 08:35:40 cgd Exp $ */
|
||||
|
||||
/*
|
||||
@ -60,6 +60,9 @@ main(int argc, char **argv)
|
||||
char *p, buf[132];
|
||||
int c, start, seenl, dflag, bflag;
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
dflag = bflag = 0;
|
||||
while ((c = getopt(argc, argv, "bdh")) != -1)
|
||||
switch(c) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: random.c,v 1.12 2009/10/27 23:59:26 deraadt Exp $ */
|
||||
/* $OpenBSD: random.c,v 1.13 2015/10/14 08:12:12 doug Exp $ */
|
||||
/* $NetBSD: random.c,v 1.3 1995/04/22 07:44:05 cgd Exp $ */
|
||||
|
||||
/*
|
||||
@ -54,6 +54,9 @@ main(int argc, char *argv[])
|
||||
int ch, random_exit, selected, unbuffer_output;
|
||||
char *ep;
|
||||
|
||||
if (pledge("stdio", NULL) == -1)
|
||||
err(1, "pledge");
|
||||
|
||||
random_exit = unbuffer_output = 0;
|
||||
while ((ch = getopt(argc, argv, "erh")) != -1)
|
||||
switch (ch) {
|
||||
|
Loading…
Reference in New Issue
Block a user