summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-09 01:37:11 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-09 01:37:11 +0000
commit7a01108f60e58c5683c269bbbb884090b5a0620f (patch)
treed28dc1713411066fb4ced6b7bb3fe35eb3a43955 /usr.bin
parent76228dc5f1e37f76feb11003febafceed8e121f0 (diff)
Change all tame callers to namechange to pledge(2).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/banner/banner.c6
-rw-r--r--usr.bin/basename/basename.c6
-rw-r--r--usr.bin/cal/cal.c6
-rw-r--r--usr.bin/col/col.c6
-rw-r--r--usr.bin/colrm/colrm.c6
-rw-r--r--usr.bin/column/column.c10
-rw-r--r--usr.bin/comm/comm.c6
-rw-r--r--usr.bin/compress/main.c6
-rw-r--r--usr.bin/csplit/csplit.c10
-rw-r--r--usr.bin/ctags/ctags.c6
-rw-r--r--usr.bin/cut/cut.c10
-rw-r--r--usr.bin/dc/dc.c14
-rw-r--r--usr.bin/deroff/deroff.c6
-rw-r--r--usr.bin/diff/diff.c10
-rw-r--r--usr.bin/diff3/diff3prog.c6
-rw-r--r--usr.bin/dirname/dirname.c6
-rw-r--r--usr.bin/expand/expand.c6
-rw-r--r--usr.bin/fgen/fgen.l6
-rw-r--r--usr.bin/file/file.c12
-rw-r--r--usr.bin/find/find.c6
-rw-r--r--usr.bin/finger/finger.c14
-rw-r--r--usr.bin/fmt/fmt.c10
-rw-r--r--usr.bin/fold/fold.c10
-rw-r--r--usr.bin/from/from.c10
-rw-r--r--usr.bin/getopt/getopt.c6
-rw-r--r--usr.bin/grep/grep.c6
-rw-r--r--usr.bin/head/head.c10
-rw-r--r--usr.bin/hexdump/hexdump.c6
-rw-r--r--usr.bin/htpasswd/htpasswd.c6
-rw-r--r--usr.bin/id/id.c6
-rw-r--r--usr.bin/indent/indent.c6
-rw-r--r--usr.bin/join/join.c10
-rw-r--r--usr.bin/jot/jot.c6
-rw-r--r--usr.bin/kdump/kdump.c10
-rw-r--r--usr.bin/kdump/ktrstruct.c14
-rw-r--r--usr.bin/lam/lam.c6
-rw-r--r--usr.bin/lastcomm/lastcomm.c6
-rw-r--r--usr.bin/leave/leave.c6
-rw-r--r--usr.bin/lock/lock.c6
-rw-r--r--usr.bin/logger/logger.c6
-rw-r--r--usr.bin/logname/logname.c6
-rw-r--r--usr.bin/look/look.c6
-rw-r--r--usr.bin/make/main.c6
-rw-r--r--usr.bin/mktemp/mktemp.c6
-rw-r--r--usr.bin/nl/nl.c6
-rw-r--r--usr.bin/nm/nm.c6
-rw-r--r--usr.bin/openssl/openssl.c6
-rw-r--r--usr.bin/paste/paste.c6
-rw-r--r--usr.bin/patch/patch.c6
-rw-r--r--usr.bin/pr/pr.c6
-rw-r--r--usr.bin/printenv/printenv.c6
-rw-r--r--usr.bin/printf/printf.c6
-rw-r--r--usr.bin/readlink/readlink.c6
-rw-r--r--usr.bin/rev/rev.c6
-rw-r--r--usr.bin/rs/rs.c6
-rw-r--r--usr.bin/script/script.c10
-rw-r--r--usr.bin/sed/main.c10
-rw-r--r--usr.bin/signify/signify.c22
-rw-r--r--usr.bin/split/split.c6
-rw-r--r--usr.bin/ssh/sandbox-pledge.c (renamed from usr.bin/ssh/sandbox-tame.c)8
-rw-r--r--usr.bin/ssh/sshd/Makefile4
-rw-r--r--usr.bin/stat/stat.c6
-rw-r--r--usr.bin/tail/tail.c10
-rw-r--r--usr.bin/tee/tee.c10
-rw-r--r--usr.bin/tftp/main.c6
-rw-r--r--usr.bin/touch/touch.c6
-rw-r--r--usr.bin/tr/tr.c6
-rw-r--r--usr.bin/tty/tty.c6
-rw-r--r--usr.bin/uname/uname.c6
-rw-r--r--usr.bin/unifdef/unifdef.c4
-rw-r--r--usr.bin/uniq/uniq.c10
-rw-r--r--usr.bin/units/units.c10
-rw-r--r--usr.bin/unvis/unvis.c10
-rw-r--r--usr.bin/users/users.c6
-rw-r--r--usr.bin/uudecode/uudecode.c10
-rw-r--r--usr.bin/uuencode/uuencode.c10
-rw-r--r--usr.bin/vis/vis.c10
-rw-r--r--usr.bin/wc/wc.c6
-rw-r--r--usr.bin/what/what.c6
-rw-r--r--usr.bin/who/who.c14
-rw-r--r--usr.bin/whois/whois.c6
-rw-r--r--usr.bin/write/write.c6
82 files changed, 312 insertions, 312 deletions
diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c
index e1c450c4644..9fb80f426d4 100644
--- a/usr.bin/banner/banner.c
+++ b/usr.bin/banner/banner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: banner.c,v 1.10 2015/10/05 05:33:29 deraadt Exp $ */
+/* $OpenBSD: banner.c,v 1.11 2015/10/09 01:37:06 deraadt Exp $ */
/* $NetBSD: banner.c,v 1.2 1995/04/09 06:00:15 cgd Exp $ */
/*
@@ -153,8 +153,8 @@ main(int argc, char *argv[])
{
char word[10+1]; /* strings limited to 10 chars */
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
while (*++argv) {
(void)strlcpy(word, *argv, sizeof (word));
scan_out(1, word, '\0');
diff --git a/usr.bin/basename/basename.c b/usr.bin/basename/basename.c
index bcdaf532103..e40142eb5f2 100644
--- a/usr.bin/basename/basename.c
+++ b/usr.bin/basename/basename.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: basename.c,v 1.10 2015/10/03 01:07:15 deraadt Exp $ */
+/* $OpenBSD: basename.c,v 1.11 2015/10/09 01:37:06 deraadt Exp $ */
/* $NetBSD: basename.c,v 1.9 1995/09/02 05:29:46 jtc Exp $ */
/*-
@@ -48,8 +48,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "")) != -1) {
switch (ch) {
diff --git a/usr.bin/cal/cal.c b/usr.bin/cal/cal.c
index 017f0addf5e..a4655bd579e 100644
--- a/usr.bin/cal/cal.c
+++ b/usr.bin/cal/cal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cal.c,v 1.29 2015/10/05 13:30:30 deraadt Exp $ */
+/* $OpenBSD: cal.c,v 1.30 2015/10/09 01:37:06 deraadt Exp $ */
/* $NetBSD: cal.c,v 1.6 1995/03/26 03:10:24 glass Exp $ */
/*
@@ -150,8 +150,8 @@ main(int argc, char *argv[])
int ch, month, year, yflag;
const char *errstr;
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
yflag = year = 0;
while ((ch = getopt(argc, argv, "jmwy")) != -1)
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c
index ff12834bd31..c3c51b4c630 100644
--- a/usr.bin/col/col.c
+++ b/usr.bin/col/col.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: col.c,v 1.18 2015/10/05 06:04:18 deraadt Exp $ */
+/* $OpenBSD: col.c,v 1.19 2015/10/09 01:37:06 deraadt Exp $ */
/* $NetBSD: col.c,v 1.7 1995/09/02 05:48:50 jtc Exp $ */
/*-
@@ -113,8 +113,8 @@ main(int argc, char *argv[])
int adjust, opt, warned;
const char *errstr;
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
max_bufd_lines = 256;
compress_spaces = 1; /* compress spaces into tabs */
diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c
index 26e601cd1c8..11b7100fc04 100644
--- a/usr.bin/colrm/colrm.c
+++ b/usr.bin/colrm/colrm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: colrm.c,v 1.10 2015/10/05 13:30:30 deraadt Exp $ */
+/* $OpenBSD: colrm.c,v 1.11 2015/10/09 01:37:06 deraadt Exp $ */
/* $NetBSD: colrm.c,v 1.4 1995/09/02 05:51:37 jtc Exp $ */
/*-
@@ -52,8 +52,8 @@ main(int argc, char *argv[])
int ch;
char *p;
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
diff --git a/usr.bin/column/column.c b/usr.bin/column/column.c
index f37aeca06bd..9db9985144e 100644
--- a/usr.bin/column/column.c
+++ b/usr.bin/column/column.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: column.c,v 1.20 2015/10/05 13:30:30 deraadt Exp $ */
+/* $OpenBSD: column.c,v 1.21 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: column.c,v 1.4 1995/09/02 05:53:03 jtc Exp $ */
/*
@@ -76,8 +76,8 @@ main(int argc, char *argv[])
} else
termwidth = win.ws_col;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
tflag = xflag = 0;
while ((ch = getopt(argc, argv, "c:s:tx")) != -1)
@@ -116,8 +116,8 @@ main(int argc, char *argv[])
}
}
}
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
if (!entries)
exit(eval);
diff --git a/usr.bin/comm/comm.c b/usr.bin/comm/comm.c
index d15b931e545..73d19291d8b 100644
--- a/usr.bin/comm/comm.c
+++ b/usr.bin/comm/comm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comm.c,v 1.9 2015/10/05 13:30:30 deraadt Exp $ */
+/* $OpenBSD: comm.c,v 1.10 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: comm.c,v 1.10 1995/09/05 19:57:43 jtc Exp $ */
/*
@@ -61,8 +61,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
flag1 = flag2 = flag3 = 1;
compare = strcoll;
diff --git a/usr.bin/compress/main.c b/usr.bin/compress/main.c
index ca773c4af26..1793da7132d 100644
--- a/usr.bin/compress/main.c
+++ b/usr.bin/compress/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.88 2015/10/04 16:50:29 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.89 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -167,8 +167,8 @@ main(int argc, char *argv[])
char outfile[PATH_MAX], _infile[PATH_MAX], suffix[16];
int bits, ch, error, rc, cflag, oflag;
- if (tame("stdio rpath wpath cpath fattr", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
+ err(1, "pledge");
bits = cflag = oflag = 0;
storename = -1;
diff --git a/usr.bin/csplit/csplit.c b/usr.bin/csplit/csplit.c
index c11bbba620d..fe80da9591d 100644
--- a/usr.bin/csplit/csplit.c
+++ b/usr.bin/csplit/csplit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: csplit.c,v 1.6 2015/10/07 03:50:10 deraadt Exp $ */
+/* $OpenBSD: csplit.c,v 1.7 2015/10/09 01:37:07 deraadt Exp $ */
/* $FreeBSD: src/usr.bin/csplit/csplit.c,v 1.9 2004/03/22 11:15:03 tjr Exp $ */
/*-
@@ -103,8 +103,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
kflag = sflag = 0;
prefix = "xx";
@@ -143,8 +143,8 @@ main(int argc, char *argv[])
if (strcmp(infn, "-") == 0) {
infile = stdin;
infn = "stdin";
- if (tame("stdio wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio wpath cpath", NULL) == -1)
+ err(1, "pledge");
} else if ((infile = fopen(infn, "r")) == NULL)
err(1, "%s", infn);
diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c
index 68d9f2f9014..595219bfb31 100644
--- a/usr.bin/ctags/ctags.c
+++ b/usr.bin/ctags/ctags.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctags.c,v 1.17 2015/10/07 06:33:31 deraadt Exp $ */
+/* $OpenBSD: ctags.c,v 1.18 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: ctags.c,v 1.4 1995/09/02 05:57:23 jtc Exp $ */
/*
@@ -77,8 +77,8 @@ main(int argc, char *argv[])
int step; /* step through args */
int ch; /* getopts char */
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
aflag = uflag = NO;
while ((ch = getopt(argc, argv, "BFadf:tuwvx")) != -1)
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c
index 2f14ce08dd3..7985a04ee93 100644
--- a/usr.bin/cut/cut.c
+++ b/usr.bin/cut/cut.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cut.c,v 1.20 2015/10/05 13:27:45 deraadt Exp $ */
+/* $OpenBSD: cut.c,v 1.21 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: cut.c,v 1.9 1995/09/02 05:59:23 jtc Exp $ */
/*
@@ -63,8 +63,8 @@ main(int argc, char *argv[])
setlocale (LC_ALL, "");
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
dchar = '\t'; /* default delimiter is \t */
@@ -121,8 +121,8 @@ main(int argc, char *argv[])
}
}
else {
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
fcn(stdin, "stdin");
}
exit(rval);
diff --git a/usr.bin/dc/dc.c b/usr.bin/dc/dc.c
index 8c796d9c1be..c50cbca0cd4 100644
--- a/usr.bin/dc/dc.c
+++ b/usr.bin/dc/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.14 2015/10/03 18:39:13 deraadt Exp $ */
+/* $OpenBSD: dc.c,v 1.15 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -47,8 +47,8 @@ main(int argc, char *argv[])
char *buf, *p;
struct stat st;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
if ((buf = strdup("")) == NULL)
err(1, NULL);
@@ -91,8 +91,8 @@ main(int argc, char *argv[])
file = fopen(argv[0], "r");
if (file == NULL)
err(1, "cannot open file %s", argv[0]);
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
if (fstat(fileno(file), &st) == -1)
err(1, "%s", argv[0]);
if (S_ISDIR(st.st_mode))
@@ -107,8 +107,8 @@ main(int argc, char *argv[])
*/
return (0);
}
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
src_setstream(&src, stdin);
reset_bmachine(&src);
eval();
diff --git a/usr.bin/deroff/deroff.c b/usr.bin/deroff/deroff.c
index 6b92034ed21..0957ec1661e 100644
--- a/usr.bin/deroff/deroff.c
+++ b/usr.bin/deroff/deroff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: deroff.c,v 1.12 2015/10/05 06:05:42 deraadt Exp $ */
+/* $OpenBSD: deroff.c,v 1.13 2015/10/09 01:37:07 deraadt Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -260,8 +260,8 @@ main(int ac, char **av)
int errflg = 0;
int kflag = NO;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
iflag = NO;
wordflag = NO;
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
index eb2d8e5d0a2..c37b8087918 100644
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.62 2015/10/05 20:15:00 millert Exp $ */
+/* $OpenBSD: diff.c,v 1.63 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -212,11 +212,11 @@ main(int argc, char **argv)
argv += optind;
if (getenv("TMPDIR")) {
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
} else {
- if (tame("stdio rpath tmppath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath tmppath", NULL) == -1)
+ err(1, "pledge");
}
/*
diff --git a/usr.bin/diff3/diff3prog.c b/usr.bin/diff3/diff3prog.c
index 921da78a548..b928b062167 100644
--- a/usr.bin/diff3/diff3prog.c
+++ b/usr.bin/diff3/diff3prog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3prog.c,v 1.16 2015/10/05 13:30:30 deraadt Exp $ */
+/* $OpenBSD: diff3prog.c,v 1.17 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -145,8 +145,8 @@ main(int argc, char **argv)
{
int ch, i, m, n;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
eflag = 0;
oflag = 0;
diff --git a/usr.bin/dirname/dirname.c b/usr.bin/dirname/dirname.c
index 1d4d8c547a0..7e0328e6f86 100644
--- a/usr.bin/dirname/dirname.c
+++ b/usr.bin/dirname/dirname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dirname.c,v 1.14 2015/10/05 13:30:30 deraadt Exp $ */
+/* $OpenBSD: dirname.c,v 1.15 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -33,8 +33,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "")) != -1) {
switch (ch) {
diff --git a/usr.bin/expand/expand.c b/usr.bin/expand/expand.c
index 2e43bd732ab..01d10ce2b1d 100644
--- a/usr.bin/expand/expand.c
+++ b/usr.bin/expand/expand.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expand.c,v 1.13 2015/10/05 13:24:39 deraadt Exp $ */
+/* $OpenBSD: expand.c,v 1.14 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: expand.c,v 1.5 1995/09/02 06:19:46 jtc Exp $ */
/*
@@ -51,8 +51,8 @@ main(int argc, char *argv[])
int c, column;
int n;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
/* handle obsolete syntax */
while (argc > 1 && argv[1][0] == '-' &&
diff --git a/usr.bin/fgen/fgen.l b/usr.bin/fgen/fgen.l
index 8930dae0d39..7248ac6aad6 100644
--- a/usr.bin/fgen/fgen.l
+++ b/usr.bin/fgen/fgen.l
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: fgen.l,v 1.11 2015/10/06 05:51:01 deraadt Exp $ */
+/* $OpenBSD: fgen.l,v 1.12 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: fgen.l,v 1.12 2001/06/13 10:46:05 wiz Exp $ */
/* FLEX input for FORTH input file scanner */
/*
@@ -960,8 +960,8 @@ main(argc, argv)
char *hdrtype = "version1";
int i;
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
outf = 1; /* stdout */
myname = argv[0];
diff --git a/usr.bin/file/file.c b/usr.bin/file/file.c
index 1ac228c3f91..65ae402286d 100644
--- a/usr.bin/file/file.c
+++ b/usr.bin/file/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.51 2015/10/06 15:39:44 deraadt Exp $ */
+/* $OpenBSD: file.c,v 1.52 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -223,7 +223,7 @@ main(int argc, char **argv)
msg.error = errno;
} else {
/*
- * tame(2) doesn't let us pass directory file
+ * pledge(2) doesn't let us pass directory file
* descriptors around - but in fact we don't need them,
* so just don't open directories or symlinks (which
* could be to directories).
@@ -351,8 +351,8 @@ child(int fd, pid_t parent, int argc, char **argv)
int i, idx;
size_t len, width = 0;
- if (tame("stdio getpw proc recvfd", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw proc recvfd", NULL) == -1)
+ err(1, "pledge");
if (geteuid() == 0) {
pw = getpwnam(FILE_USER);
@@ -366,8 +366,8 @@ child(int fd, pid_t parent, int argc, char **argv)
err(1, "setresuid");
}
- if (tame("stdio recvfd", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio recvfd", NULL) == -1)
+ err(1, "pledge");
m = magic_load(magicfp, magicpath, cflag || Wflag);
if (cflag) {
diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c
index 0b5e8ec0120..3aa979b95c7 100644
--- a/usr.bin/find/find.c
+++ b/usr.bin/find/find.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: find.c,v 1.18 2015/10/05 15:25:16 deraadt Exp $ */
+/* $OpenBSD: find.c,v 1.19 2015/10/09 01:37:07 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -155,8 +155,8 @@ find_execute(PLAN *plan, /* search plan */
PLAN *p;
if (mayexecve == 0)
- if (tame("stdio getpw rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw rpath", NULL) == -1)
+ err(1, "pledge");
rval = 0;
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 1f065d865fe..d8b755cbd1e 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: finger.c,v 1.21 2015/10/03 02:09:33 deraadt Exp $ */
+/* $OpenBSD: finger.c,v 1.22 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -126,8 +126,8 @@ main(int argc, char *argv[])
mflag++;
}
- if (tame("stdio getpw rpath inet", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw rpath inet", NULL) == -1)
+ err(1, "pledge");
(void)time(&now);
setpassent(1);
@@ -137,8 +137,8 @@ main(int argc, char *argv[])
* not selected. Force the -s BEFORE we get names so proper
* screening will be done.
*/
- if (tame("stdio getpw rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw rpath", NULL) == -1)
+ err(1, "pledge");
if (!lflag)
sflag = 1; /* if -l not explicit, force -s */
loginlist();
@@ -220,8 +220,8 @@ userlist(int argc, char **argv)
goto net;
if (nettail == &nethead)
- if (tame("stdio getpw rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw rpath", NULL) == -1)
+ err(1, "pledge");
/*
* traverse the list of possible login names and check the login name
diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c
index bb9f42b2184..7bf480a1ade 100644
--- a/usr.bin/fmt/fmt.c
+++ b/usr.bin/fmt/fmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fmt.c,v 1.32 2015/10/05 06:21:15 deraadt Exp $ */
+/* $OpenBSD: fmt.c,v 1.33 2015/10/09 01:37:07 deraadt Exp $ */
/* Sensible version of fmt
*
@@ -255,8 +255,8 @@ main(int argc, char *argv[])
(void)setlocale(LC_CTYPE, "");
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
/* 1. Grok parameters. */
while ((ch = getopt(argc, argv, "0123456789cd:hl:mnpst:w:")) != -1) {
@@ -340,8 +340,8 @@ main(int argc, char *argv[])
while (argc-- > 0)
process_named_file(*argv++);
} else {
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
process_stream(stdin, "standard input");
}
diff --git a/usr.bin/fold/fold.c b/usr.bin/fold/fold.c
index 521971de6c6..90d4ed592a9 100644
--- a/usr.bin/fold/fold.c
+++ b/usr.bin/fold/fold.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fold.c,v 1.16 2015/10/05 06:26:33 deraadt Exp $ */
+/* $OpenBSD: fold.c,v 1.17 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: fold.c,v 1.6 1995/09/01 01:42:44 jtc Exp $ */
/*-
@@ -56,8 +56,8 @@ main(int argc, char *argv[])
unsigned int width;
const char *errstr;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
width = 0;
lastch = '\0';
@@ -103,8 +103,8 @@ main(int argc, char *argv[])
width = DEFLINEWIDTH;
if (!*argv) {
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
fold(width);
} else {
for (; *argv; ++argv) {
diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c
index f6ecef03539..743e0981dc1 100644
--- a/usr.bin/from/from.c
+++ b/usr.bin/from/from.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: from.c,v 1.21 2015/10/07 06:51:50 deraadt Exp $ */
+/* $OpenBSD: from.c,v 1.22 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */
/*
@@ -74,16 +74,16 @@ main(int argc, char *argv[])
}
argv += optind;
- if (tame("stdio rpath getpw", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath getpw", NULL) == -1)
+ err(1, "pledge");
file = mail_spool(file, *argv);
if ((fp = fopen(file, "r")) == NULL) {
if (!fflag && errno == ENOENT)
exit(EXIT_SUCCESS);
err(1, "%s", file);
}
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
for (newline = 1; (linelen = getline(&line, &linesize, fp)) != -1;) {
if (*line == '\n') {
newline = 1;
diff --git a/usr.bin/getopt/getopt.c b/usr.bin/getopt/getopt.c
index b0781e62058..ea971bbf64a 100644
--- a/usr.bin/getopt/getopt.c
+++ b/usr.bin/getopt/getopt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getopt.c,v 1.9 2015/10/07 06:39:16 deraadt Exp $ */
+/* $OpenBSD: getopt.c,v 1.10 2015/10/09 01:37:07 deraadt Exp $ */
/*
* This material, written by Henry Spencer, was released by him
@@ -18,8 +18,8 @@ main(int argc, char *argv[])
int c;
int status = 0;
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
optind = 2; /* Past the program name and the option letters. */
while ((c = getopt(argc, argv, argv[1])) != -1)
diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c
index d3536387a9d..f790e1d5d7e 100644
--- a/usr.bin/grep/grep.c
+++ b/usr.bin/grep/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.53 2015/10/03 05:36:34 deraadt Exp $ */
+/* $OpenBSD: grep.c,v 1.54 2015/10/09 01:37:07 deraadt Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -238,8 +238,8 @@ main(int argc, char *argv[])
char **expr;
const char *errstr;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
SLIST_INIT(&patfilelh);
switch (__progname[0]) {
diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c
index e5120e48d36..383a4ae0d6f 100644
--- a/usr.bin/head/head.c
+++ b/usr.bin/head/head.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: head.c,v 1.19 2015/10/07 06:55:10 deraadt Exp $ */
+/* $OpenBSD: head.c,v 1.20 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (c) 1980, 1987 Regents of the University of California.
@@ -55,8 +55,8 @@ main(int argc, char *argv[])
char *p = NULL;
int status = 0;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
/* handle obsolete -number syntax */
if (argc > 1 && argv[1][0] == '-' &&
@@ -90,8 +90,8 @@ main(int argc, char *argv[])
if (!firsttime)
exit(status);
fp = stdin;
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
} else {
if ((fp = fopen(*argv, "r")) == NULL) {
warn("%s", *argv++);
diff --git a/usr.bin/hexdump/hexdump.c b/usr.bin/hexdump/hexdump.c
index 539c5d1c4e6..741e56a9d1d 100644
--- a/usr.bin/hexdump/hexdump.c
+++ b/usr.bin/hexdump/hexdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hexdump.c,v 1.18 2015/10/05 06:36:18 deraadt Exp $ */
+/* $OpenBSD: hexdump.c,v 1.19 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: hexdump.c,v 1.7 1997/10/19 02:34:06 lukem Exp $ */
/*
@@ -54,8 +54,8 @@ main(int argc, char *argv[])
FS *tfs;
char *p;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od"))
newsyntax(argc, &argv);
diff --git a/usr.bin/htpasswd/htpasswd.c b/usr.bin/htpasswd/htpasswd.c
index 1ac7a9fc331..fc285c24758 100644
--- a/usr.bin/htpasswd/htpasswd.c
+++ b/usr.bin/htpasswd/htpasswd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: htpasswd.c,v 1.12 2015/10/07 06:44:01 deraadt Exp $ */
+/* $OpenBSD: htpasswd.c,v 1.13 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (c) 2014 Florian Obser <florian@openbsd.org>
*
@@ -57,8 +57,8 @@ main(int argc, char** argv)
ssize_t linelen;
mode_t old_umask;
- if (tame("stdio rpath wpath cpath tmppath tty", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath tmppath tty", NULL) == -1)
+ err(1, "pledge");
while ((c = getopt(argc, argv, "I")) != -1) {
switch (c) {
diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c
index e6b3d20ae8b..ba107339794 100644
--- a/usr.bin/id/id.c
+++ b/usr.bin/id/id.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: id.c,v 1.25 2015/10/05 06:43:31 deraadt Exp $ */
+/* $OpenBSD: id.c,v 1.26 2015/10/09 01:37:07 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -58,8 +58,8 @@ main(int argc, char *argv[])
gid_t gid;
const char *opts;
- if (tame("stdio getpw", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw", NULL) == -1)
+ err(1, "pledge");
cflag = Gflag = gflag = nflag = pflag = rflag = uflag = 0;
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index fac42540636..13ff0d2e887 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: indent.c,v 1.28 2015/10/05 23:42:40 deraadt Exp $ */
+/* $OpenBSD: indent.c,v 1.29 2015/10/09 01:37:07 deraadt Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -78,8 +78,8 @@ main(int argc, char **argv)
int last_else = 0; /* true iff last keyword was an else */
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
/*-----------------------------------------------*\
| INITIALIZATION |
diff --git a/usr.bin/join/join.c b/usr.bin/join/join.c
index ee51c1cac20..3049a423196 100644
--- a/usr.bin/join/join.c
+++ b/usr.bin/join/join.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: join.c,v 1.26 2015/10/07 04:00:45 deraadt Exp $ */
+/* $OpenBSD: join.c,v 1.27 2015/10/09 01:37:07 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -104,8 +104,8 @@ main(int argc, char *argv[])
int aflag, ch, cval, vflag;
char *end;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
F1 = &input1;
F2 = &input2;
@@ -211,8 +211,8 @@ main(int argc, char *argv[])
if (F1->fp == stdin && F2->fp == stdin)
errx(1, "only one input file may be stdin");
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
F1->setusedc = 0;
F2->setusedc = 0;
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c
index 2ab180ce069..8952ead4094 100644
--- a/usr.bin/jot/jot.c
+++ b/usr.bin/jot/jot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: jot.c,v 1.25 2015/10/06 22:55:51 deraadt Exp $ */
+/* $OpenBSD: jot.c,v 1.26 2015/10/09 01:37:07 deraadt Exp $ */
/* $NetBSD: jot.c,v 1.3 1994/12/02 20:29:43 pk Exp $ */
/*-
@@ -84,8 +84,8 @@ main(int argc, char *argv[])
int ch;
const char *errstr;
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "rb:w:cs:np:")) != -1)
switch (ch) {
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index a74ca70d587..a9257581bca 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kdump.c,v 1.112 2015/10/06 03:27:25 deraadt Exp $ */
+/* $OpenBSD: kdump.c,v 1.113 2015/10/09 01:37:08 deraadt Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -241,8 +241,8 @@ main(int argc, char *argv[])
if (argc > optind)
usage();
- if (tame("stdio getpw rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw rpath", NULL) == -1)
+ err(1, "pledge");
m = malloc(size = 1025);
if (m == NULL)
@@ -250,8 +250,8 @@ main(int argc, char *argv[])
if (!freopen(tracefile, "r", stdin))
err(1, "%s", tracefile);
- if (tame("stdio getpw", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw", NULL) == -1)
+ err(1, "pledge");
if (fread_tail(&ktr_header, sizeof(struct ktr_header), 1) == 0 ||
ktr_header.ktr_type != htobe32(KTR_START))
diff --git a/usr.bin/kdump/ktrstruct.c b/usr.bin/kdump/ktrstruct.c
index 6adffa3ecc6..a19971ee077 100644
--- a/usr.bin/kdump/ktrstruct.c
+++ b/usr.bin/kdump/ktrstruct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ktrstruct.c,v 1.11 2015/10/03 23:52:30 guenther Exp $ */
+/* $OpenBSD: ktrstruct.c,v 1.12 2015/10/09 01:37:08 deraadt Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -560,13 +560,13 @@ ktrstruct(char *buf, size_t buflen)
memcpy(cmsg, data, datalen);
ktrcmsghdr(cmsg, datalen);
free(cmsg);
- } else if (strcmp(name, "tamereq") == 0) {
- printf("tame request=");
- showbufc(basecol + sizeof("tame request=") - 1,
+ } else if (strcmp(name, "pledgereq") == 0) {
+ printf("pledge request=");
+ showbufc(basecol + sizeof("pledge request=") - 1,
(unsigned char *)data, datalen);
- } else if (strcmp(name, "tamepath") == 0) {
- printf("tame path=");
- showbufc(basecol + sizeof("tame path=") - 1,
+ } else if (strcmp(name, "pledgepath") == 0) {
+ printf("pledge path=");
+ showbufc(basecol + sizeof("pledge path=") - 1,
(unsigned char *)data, datalen);
} else {
printf("unknown structure %s\n", name);
diff --git a/usr.bin/lam/lam.c b/usr.bin/lam/lam.c
index 1f10025d6d3..a2a70e9747c 100644
--- a/usr.bin/lam/lam.c
+++ b/usr.bin/lam/lam.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lam.c,v 1.18 2015/10/07 04:03:57 deraadt Exp $ */
+/* $OpenBSD: lam.c,v 1.19 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: lam.c,v 1.2 1994/11/14 20:27:42 jtc Exp $ */
/*-
@@ -71,8 +71,8 @@ main(int argc, char *argv[])
{
int i;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
/* Process arguments, set numfiles to file argument count. */
getargs(argc, argv);
diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c
index b4843dc160c..2e02770b366 100644
--- a/usr.bin/lastcomm/lastcomm.c
+++ b/usr.bin/lastcomm/lastcomm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lastcomm.c,v 1.22 2015/10/07 14:05:07 deraadt Exp $ */
+/* $OpenBSD: lastcomm.c,v 1.23 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: lastcomm.c,v 1.9 1995/10/22 01:43:42 ghudson Exp $ */
/*
@@ -69,8 +69,8 @@ main(int argc, char *argv[])
int ch;
char *acctfile;
- if (tame("stdio rpath getpw", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath getpw", NULL) == -1)
+ err(1, "pledge");
acctfile = _PATH_ACCT;
while ((ch = getopt(argc, argv, "f:")) != -1)
diff --git a/usr.bin/leave/leave.c b/usr.bin/leave/leave.c
index e7493d54a0b..ec11d62735a 100644
--- a/usr.bin/leave/leave.c
+++ b/usr.bin/leave/leave.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: leave.c,v 1.16 2015/10/03 05:13:23 deraadt Exp $ */
+/* $OpenBSD: leave.c,v 1.17 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: leave.c,v 1.4 1995/07/03 16:50:13 phil Exp $ */
/*
@@ -63,8 +63,8 @@ main(int argc, char *argv[])
int plusnow = 0, twentyfour;
char buf[50];
- if (tame("stdio proc", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio proc", NULL) == -1)
+ err(1, "pledge");
if (setvbuf(stdout, NULL, _IOLBF, 0) != 0)
errx(1, "Cannot set stdout to line buffered.");
diff --git a/usr.bin/lock/lock.c b/usr.bin/lock/lock.c
index b1a31dedcfc..572f501081e 100644
--- a/usr.bin/lock/lock.c
+++ b/usr.bin/lock/lock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock.c,v 1.29 2015/10/07 04:05:24 deraadt Exp $ */
+/* $OpenBSD: lock.c,v 1.30 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: lock.c,v 1.8 1996/05/07 18:32:31 jtc Exp $ */
/*
@@ -90,8 +90,8 @@ main(int argc, char *argv[])
usemine = 0;
no_timeout = 0;
- if (tame("stdio getpw rpath wpath tty", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw rpath wpath tty", NULL) == -1)
+ err(1, "pledge");
if (!(pw = getpwuid(getuid())))
errx(1, "unknown uid %u.", getuid());
diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c
index 01b8eb1f104..7450bc9d836 100644
--- a/usr.bin/logger/logger.c
+++ b/usr.bin/logger/logger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: logger.c,v 1.15 2015/10/05 23:59:11 deraadt Exp $ */
+/* $OpenBSD: logger.c,v 1.16 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: logger.c,v 1.4 1994/12/22 06:27:00 jtc Exp $ */
/*
@@ -93,8 +93,8 @@ main(int argc, char *argv[])
openlog(tag ? tag : getlogin(), logflags, 0);
(void) fclose(stdout);
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
/* log input line if appropriate */
if (argc > 0) {
diff --git a/usr.bin/logname/logname.c b/usr.bin/logname/logname.c
index ab7499caf64..618a2d34843 100644
--- a/usr.bin/logname/logname.c
+++ b/usr.bin/logname/logname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: logname.c,v 1.8 2015/10/07 14:06:26 deraadt Exp $ */
+/* $OpenBSD: logname.c,v 1.9 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: logname.c,v 1.6 1994/12/22 06:39:32 jtc Exp $ */
/*-
@@ -46,8 +46,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "")) != -1)
switch (ch) {
diff --git a/usr.bin/look/look.c b/usr.bin/look/look.c
index 86c66fee630..be81ee53d42 100644
--- a/usr.bin/look/look.c
+++ b/usr.bin/look/look.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: look.c,v 1.17 2015/10/07 14:13:23 deraadt Exp $ */
+/* $OpenBSD: look.c,v 1.18 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: look.c,v 1.7 1995/08/31 22:41:02 jtc Exp $ */
/*-
@@ -88,8 +88,8 @@ main(int argc, char *argv[])
int ch, fd, termchar;
char *back, *file, *front, *string, *p;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
file = _PATH_WORDS;
termchar = '\0';
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 891d8602b3a..77fb6d08abe 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.113 2015/10/08 14:49:27 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.114 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */
/*
@@ -192,8 +192,8 @@ MainParseArgs(int argc, char **argv)
#define OPTFLAGS "BC:D:I:SV:d:ef:ij:km:npqrst"
#define OPTLETTERS "BSiknpqrst"
- if (tame("stdio rpath wpath cpath proc exec", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1)
+ err(1, "pledge");
optind = 1; /* since we're called more than once */
optreset = 1;
diff --git a/usr.bin/mktemp/mktemp.c b/usr.bin/mktemp/mktemp.c
index 6355c193aa9..713b67fd105 100644
--- a/usr.bin/mktemp/mktemp.c
+++ b/usr.bin/mktemp/mktemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mktemp.c,v 1.21 2015/10/07 06:43:15 deraadt Exp $ */
+/* $OpenBSD: mktemp.c,v 1.22 2015/10/09 01:37:08 deraadt Exp $ */
/*
* Copyright (c) 1996, 1997, 2001-2003, 2013
@@ -38,8 +38,8 @@ main(int argc, char *argv[])
char *cp, *template, *tempfile, *prefix = _PATH_TMP;
size_t len;
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "dp:qtu")) != -1)
switch(ch) {
diff --git a/usr.bin/nl/nl.c b/usr.bin/nl/nl.c
index 59e3af8ba20..e4c1e2d6177 100644
--- a/usr.bin/nl/nl.c
+++ b/usr.bin/nl/nl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nl.c,v 1.5 2015/10/07 07:00:01 deraadt Exp $ */
+/* $OpenBSD: nl.c,v 1.6 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: nl.c,v 1.11 2011/08/16 12:00:46 christos Exp $ */
/*-
@@ -118,8 +118,8 @@ main(int argc, char *argv[])
(void)setlocale(LC_ALL, "");
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
while ((c = getopt(argc, argv, "pb:d:f:h:i:l:n:s:v:w:")) != -1) {
switch (c) {
diff --git a/usr.bin/nm/nm.c b/usr.bin/nm/nm.c
index c1b0d19f6fc..1872486f889 100644
--- a/usr.bin/nm/nm.c
+++ b/usr.bin/nm/nm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nm.c,v 1.48 2015/10/05 07:16:03 deraadt Exp $ */
+/* $OpenBSD: nm.c,v 1.49 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: nm.c,v 1.7 1996/01/14 23:04:03 pk Exp $ */
/*
@@ -212,8 +212,8 @@ main(int argc, char *argv[])
if (demangle)
pipe2cppfilt();
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
argv += optind;
argc -= optind;
diff --git a/usr.bin/openssl/openssl.c b/usr.bin/openssl/openssl.c
index 21a5aa60184..8ac645636a8 100644
--- a/usr.bin/openssl/openssl.c
+++ b/usr.bin/openssl/openssl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openssl.c,v 1.14 2015/10/07 05:21:41 deraadt Exp $ */
+/* $OpenBSD: openssl.c,v 1.15 2015/10/09 01:37:08 deraadt Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -436,8 +436,8 @@ main(int argc, char **argv)
arg.data = NULL;
arg.count = 0;
- if (tame("stdio inet rpath cpath wpath proc", NULL) == -1) {
- fprintf(stderr, "openssl: tame: %s\n", strerror(errno));
+ if (pledge("stdio inet rpath cpath wpath proc", NULL) == -1) {
+ fprintf(stderr, "openssl: pledge: %s\n", strerror(errno));
exit(1);
}
diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c
index ee73fbe136d..ef4c62d926b 100644
--- a/usr.bin/paste/paste.c
+++ b/usr.bin/paste/paste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paste.c,v 1.20 2015/10/07 14:12:42 deraadt Exp $ */
+/* $OpenBSD: paste.c,v 1.21 2015/10/09 01:37:08 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -57,8 +57,8 @@ main(int argc, char *argv[])
extern int optind;
int ch, seq;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
seq = 0;
while ((ch = getopt(argc, argv, "d:s")) != -1) {
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index ad477a2bd1e..0d0c5058484 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.58 2015/10/07 06:29:26 deraadt Exp $ */
+/* $OpenBSD: patch.c,v 1.59 2015/10/09 01:37:08 deraadt Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -147,8 +147,8 @@ main(int argc, char *argv[])
const char *tmpdir;
char *v;
- if (tame("stdio rpath wpath cpath tmppath fattr proc exec", NULL) == -1)
- perror("tame");
+ if (pledge("stdio rpath wpath cpath tmppath fattr proc exec", NULL) == -1)
+ perror("pledge");
setvbuf(stdout, NULL, _IOLBF, 0);
setvbuf(stderr, NULL, _IOLBF, 0);
diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c
index a3ab9d8661e..950576e7ead 100644
--- a/usr.bin/pr/pr.c
+++ b/usr.bin/pr/pr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pr.c,v 1.37 2015/10/07 06:15:51 deraadt Exp $ */
+/* $OpenBSD: pr.c,v 1.38 2015/10/09 01:37:08 deraadt Exp $ */
/*-
* Copyright (c) 1991 Keith Muller.
@@ -140,8 +140,8 @@ main(int argc, char *argv[])
{
int ret_val;
- if (tame("stdio rpath", NULL) == -1)
- perror("tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ perror("pledge");
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
(void)signal(SIGINT, terminate);
diff --git a/usr.bin/printenv/printenv.c b/usr.bin/printenv/printenv.c
index a0be932b36d..fc0b225e410 100644
--- a/usr.bin/printenv/printenv.c
+++ b/usr.bin/printenv/printenv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printenv.c,v 1.7 2015/10/07 06:35:19 deraadt Exp $ */
+/* $OpenBSD: printenv.c,v 1.8 2015/10/09 01:37:08 deraadt Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
@@ -48,8 +48,8 @@ main(int argc, char *argv[])
char *cp, **ep;
int len;
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
if (argc < 2) {
for (ep = environ; *ep; ep++)
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index f7883ea969d..73eb5b28cbb 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printf.c,v 1.23 2015/10/06 23:01:43 deraadt Exp $ */
+/* $OpenBSD: printf.c,v 1.24 2015/10/09 01:37:08 deraadt Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -82,8 +82,8 @@ main(int argc, char *argv[])
setlocale (LC_ALL, "");
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
/* Need to accept/ignore "--" option. */
if (argc > 1 && strcmp(argv[1], "--") == 0) {
diff --git a/usr.bin/readlink/readlink.c b/usr.bin/readlink/readlink.c
index a5a0445283a..6380b3e0e46 100644
--- a/usr.bin/readlink/readlink.c
+++ b/usr.bin/readlink/readlink.c
@@ -1,5 +1,5 @@
/*
- * $OpenBSD: readlink.c,v 1.26 2015/10/07 14:10:50 deraadt Exp $
+ * $OpenBSD: readlink.c,v 1.27 2015/10/09 01:37:08 deraadt Exp $
*
* Copyright (c) 1997
* Kenneth Stailey (hereinafter referred to as the author)
@@ -44,8 +44,8 @@ main(int argc, char *argv[])
int n, ch, nflag = 0, fflag = 0;
extern int optind;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "fn")) != -1)
switch (ch) {
diff --git a/usr.bin/rev/rev.c b/usr.bin/rev/rev.c
index c24980b3945..abcfcff1581 100644
--- a/usr.bin/rev/rev.c
+++ b/usr.bin/rev/rev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rev.c,v 1.11 2015/10/07 06:18:00 deraadt Exp $ */
+/* $OpenBSD: rev.c,v 1.12 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: rev.c,v 1.5 1995/09/28 08:49:40 tls Exp $ */
/*-
@@ -49,8 +49,8 @@ main(int argc, char *argv[])
size_t len;
int ch, rval;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c
index 90f26aad4ac..7b5da82b1d4 100644
--- a/usr.bin/rs/rs.c
+++ b/usr.bin/rs/rs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rs.c,v 1.26 2015/10/06 03:26:31 deraadt Exp $ */
+/* $OpenBSD: rs.c,v 1.27 2015/10/09 01:37:08 deraadt Exp $ */
/*-
* Copyright (c) 1993
@@ -93,8 +93,8 @@ void putfile(void);
int
main(int argc, char *argv[])
{
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
getargs(argc, argv);
getfile();
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c
index 1bb97d72809..b05e5ac4ea3 100644
--- a/usr.bin/script/script.c
+++ b/usr.bin/script/script.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: script.c,v 1.30 2015/10/07 05:08:27 deraadt Exp $ */
+/* $OpenBSD: script.c,v 1.31 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: script.c,v 1.3 1994/12/21 08:55:43 jtc Exp $ */
/*
@@ -165,8 +165,8 @@ main(int argc, char *argv[])
sa.sa_handler = finish;
(void)sigaction(SIGCHLD, &sa, NULL);
- if (tame("stdio tty", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio tty", NULL) == -1)
+ err(1, "pledge");
(void)fclose(fscript);
while (1) {
@@ -251,8 +251,8 @@ dooutput(void)
sa.sa_handler = SIG_IGN;
(void)sigaction(SIGCHLD, &sa, NULL);
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
value.it_interval.tv_sec = 30;
value.it_interval.tv_usec = 0;
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 1e91848914a..50ed1c01a3d 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.25 2015/10/03 00:58:59 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.26 2015/10/09 01:37:08 deraadt Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -160,11 +160,11 @@ main(int argc, char *argv[])
termwidth = 60;
if (inplace != NULL) {
- if (tame("stdio wpath rpath cpath fattr", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio wpath rpath cpath fattr", NULL) == -1)
+ err(1, "pledge");
} else {
- if (tame("stdio wpath rpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio wpath rpath cpath", NULL) == -1)
+ err(1, "pledge");
}
/* First usage case; script is the first arg */
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c
index ec80973a5b0..5a9b20bfe02 100644
--- a/usr.bin/signify/signify.c
+++ b/usr.bin/signify/signify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signify.c,v 1.101 2015/10/08 16:45:50 tedu Exp $ */
+/* $OpenBSD: signify.c,v 1.102 2015/10/09 01:37:08 deraadt Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
@@ -663,8 +663,8 @@ main(int argc, char **argv)
VERIFY
} verb = NONE;
- if (tame("stdio rpath wpath cpath tty", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath tty", NULL) == -1)
+ err(1, "pledge");
rounds = 42;
@@ -730,21 +730,21 @@ main(int argc, char **argv)
/* keep it all */
break;
case CHECK:
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
break;
case VERIFY:
if (embedded && (!msgfile || strcmp(msgfile, "-") != 0)) {
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
} else {
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
}
break;
default:
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
break;
}
diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c
index d0306e57629..3183cbce7fa 100644
--- a/usr.bin/split/split.c
+++ b/usr.bin/split/split.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: split.c,v 1.19 2015/10/07 14:37:11 deraadt Exp $ */
+/* $OpenBSD: split.c,v 1.20 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: split.c,v 1.5 1995/08/31 22:22:05 jtc Exp $ */
/*
@@ -68,8 +68,8 @@ main(int argc, char *argv[])
char *ep, *p;
const char *errstr;
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "0123456789a:b:l:p:-")) != -1)
switch (ch) {
diff --git a/usr.bin/ssh/sandbox-tame.c b/usr.bin/ssh/sandbox-pledge.c
index 12c91adea7a..592e32ba703 100644
--- a/usr.bin/ssh/sandbox-tame.c
+++ b/usr.bin/ssh/sandbox-pledge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sandbox-tame.c,v 1.2 2015/10/02 15:52:55 deraadt Exp $ */
+/* $OpenBSD: sandbox-pledge.c,v 1.1 2015/10/09 01:37:08 deraadt Exp $ */
/*
* Copyright (c) 2015 Theo de Raadt <deraadt@openbsd.org>
*
@@ -42,7 +42,7 @@ ssh_sandbox_init(void)
{
struct ssh_sandbox *box;
- debug3("%s: preparing tame sandbox", __func__);
+ debug3("%s: preparing pledge sandbox", __func__);
box = xcalloc(1, sizeof(*box));
box->child_pid = 0;
@@ -52,8 +52,8 @@ ssh_sandbox_init(void)
void
ssh_sandbox_child(struct ssh_sandbox *box)
{
- if (tame("stdio", NULL) == -1)
- fatal("%s: tame()", __func__);
+ if (pledge("stdio", NULL) == -1)
+ fatal("%s: pledge()", __func__);
}
void
diff --git a/usr.bin/ssh/sshd/Makefile b/usr.bin/ssh/sshd/Makefile
index 329071193d1..7ab42f6d7ca 100644
--- a/usr.bin/ssh/sshd/Makefile
+++ b/usr.bin/ssh/sshd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.86 2015/10/03 02:37:30 deraadt Exp $
+# $OpenBSD: Makefile,v 1.87 2015/10/09 01:37:08 deraadt Exp $
.PATH: ${.CURDIR}/..
.include "${.CURDIR}/../Makefile.inc"
@@ -17,7 +17,7 @@ SRCS= sshd.c auth-rhosts.c auth-passwd.c \
auth2-none.c auth2-passwd.c auth2-pubkey.c \
monitor_mm.c monitor.c monitor_wrap.c \
sftp-server.c sftp-common.c \
- roaming_common.c roaming_serv.c sandbox-tame.c
+ roaming_common.c roaming_serv.c sandbox-pledge.c
.if (${SSH1:L} == "yes")
SRCS+= auth-rsa.c auth-rh-rsa.c auth1.c
diff --git a/usr.bin/stat/stat.c b/usr.bin/stat/stat.c
index 3a3116f4cbe..ee607f47532 100644
--- a/usr.bin/stat/stat.c
+++ b/usr.bin/stat/stat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stat.c,v 1.19 2015/10/06 00:24:20 deraadt Exp $ */
+/* $OpenBSD: stat.c,v 1.20 2015/10/09 01:37:08 deraadt Exp $ */
/* $NetBSD: stat.c,v 1.19 2004/06/20 22:20:16 jmc Exp $ */
/*
@@ -158,8 +158,8 @@ main(int argc, char *argv[])
int lsF, fmtchar, usestat, fn, nonl, quiet;
char *statfmt, *options, *synopsis;
- if (tame("stdio getpw rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw rpath", NULL) == -1)
+ err(1, "pledge");
lsF = 0;
fmtchar = '\0';
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c
index 41eca1594be..e543e0b9b2f 100644
--- a/usr.bin/tail/tail.c
+++ b/usr.bin/tail/tail.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tail.c,v 1.18 2015/10/07 03:49:41 deraadt Exp $ */
+/* $OpenBSD: tail.c,v 1.19 2015/10/09 01:37:09 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -61,8 +61,8 @@ main(int argc, char *argv[])
int ch, first;
char *p;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
/*
* Tail's options are weird. First, -n10 is the same as -n-10, not
@@ -174,8 +174,8 @@ main(int argc, char *argv[])
(void)fclose(fp);
}
else {
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
fname = "stdin";
is_stdin = 1;
diff --git a/usr.bin/tee/tee.c b/usr.bin/tee/tee.c
index 91bf24cac1e..8da58303ae2 100644
--- a/usr.bin/tee/tee.c
+++ b/usr.bin/tee/tee.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tee.c,v 1.9 2015/10/07 14:34:34 deraadt Exp $ */
+/* $OpenBSD: tee.c,v 1.10 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: tee.c,v 1.5 1994/12/09 01:43:39 jtc Exp $ */
/*
@@ -74,8 +74,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- if (tame("stdio wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio wpath cpath", NULL) == -1)
+ err(1, "pledge");
append = 0;
while ((ch = getopt(argc, argv, "ai")) != -1) {
@@ -108,8 +108,8 @@ main(int argc, char *argv[])
argv++;
}
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
while ((rval = read(STDIN_FILENO, buf, sizeof(buf))) > 0) {
for (p = head; p; p = p->next) {
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index 152b6617524..37ea7d565f8 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.36 2015/10/07 14:36:07 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.37 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */
/*
@@ -171,8 +171,8 @@ main(int argc, char *argv[])
{
f = -1;
- if (tame("stdio inet rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio inet rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
/* set default transfer mode */
strlcpy(mode, "netascii", sizeof(mode));
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
index d446176dca8..ec4821eac37 100644
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: touch.c,v 1.24 2015/10/06 13:48:34 deraadt Exp $ */
+/* $OpenBSD: touch.c,v 1.25 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: touch.c,v 1.11 1995/08/31 22:10:06 jtc Exp $ */
/*
@@ -60,8 +60,8 @@ main(int argc, char *argv[])
(void)setlocale(LC_ALL, "");
- if (tame("stdio rpath wpath cpath fattr", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
+ err(1, "pledge");
aflag = cflag = mflag = timeset = 0;
while ((ch = getopt(argc, argv, "acd:fmr:t:")) != -1)
diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c
index 767660d57e8..18905a23a79 100644
--- a/usr.bin/tr/tr.c
+++ b/usr.bin/tr/tr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tr.c,v 1.18 2015/10/06 13:49:33 deraadt Exp $ */
+/* $OpenBSD: tr.c,v 1.19 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: tr.c,v 1.5 1995/08/31 22:13:48 jtc Exp $ */
/*
@@ -87,8 +87,8 @@ main(int argc, char *argv[])
int ch, cnt, lastch, *p;
int cflag, dflag, sflag, isstring2;
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
cflag = dflag = sflag = 0;
while ((ch = getopt(argc, argv, "Ccds")) != -1)
diff --git a/usr.bin/tty/tty.c b/usr.bin/tty/tty.c
index e7c451824e2..bd9c20d3ec9 100644
--- a/usr.bin/tty/tty.c
+++ b/usr.bin/tty/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.8 2015/10/07 18:00:06 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.9 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: tty.c,v 1.4 1994/12/07 00:46:57 jtc Exp $ */
/*
@@ -43,8 +43,8 @@ main(int argc, char *argv[])
int ch, sflag;
char *t;
- if (tame("stdio rpath tty", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath tty", NULL) == -1)
+ err(1, "pledge");
sflag = 0;
while ((ch = getopt(argc, argv, "s")) != -1) {
diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c
index 85ac7dc1186..ad8dcb4a76c 100644
--- a/usr.bin/uname/uname.c
+++ b/usr.bin/uname/uname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uname.c,v 1.15 2015/10/03 12:41:16 deraadt Exp $ */
+/* $OpenBSD: uname.c,v 1.16 2015/10/09 01:37:09 deraadt Exp $ */
/*
* Copyright (c) 1994 Winning Strategies, Inc.
@@ -59,8 +59,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
while ((c = getopt(argc, argv, "amnrsvp")) != -1 ) {
switch (c) {
diff --git a/usr.bin/unifdef/unifdef.c b/usr.bin/unifdef/unifdef.c
index 4a08dc2d764..13b871b3917 100644
--- a/usr.bin/unifdef/unifdef.c
+++ b/usr.bin/unifdef/unifdef.c
@@ -265,8 +265,8 @@ main(int argc, char *argv[])
const char *errstr;
int opt;
- if (tame("stdio rpath wpath cpath fattr", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
+ err(1, "pledge");
while ((opt = getopt(argc, argv, "i:D:U:f:I:M:o:x:bBcdehKklmnsStV")) != -1)
switch (opt) {
diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c
index 414be50c3fe..9404c7d738a 100644
--- a/usr.bin/uniq/uniq.c
+++ b/usr.bin/uniq/uniq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uniq.c,v 1.21 2015/10/04 04:56:50 deraadt Exp $ */
+/* $OpenBSD: uniq.c,v 1.22 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: uniq.c,v 1.7 1995/08/31 22:03:48 jtc Exp $ */
/*
@@ -61,8 +61,8 @@ main(int argc, char *argv[])
int ch;
char *prevline, *thisline;
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
obsolete(argv);
while ((ch = getopt(argc, argv, "cdf:s:u")) != -1) {
@@ -122,8 +122,8 @@ main(int argc, char *argv[])
usage();
}
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
prevline = malloc(MAXLINELEN);
thisline = malloc(MAXLINELEN);
diff --git a/usr.bin/units/units.c b/usr.bin/units/units.c
index b4b7e6e8049..98af5031fb1 100644
--- a/usr.bin/units/units.c
+++ b/usr.bin/units/units.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: units.c,v 1.21 2015/10/06 13:29:56 deraadt Exp $ */
+/* $OpenBSD: units.c,v 1.22 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: units.c,v 1.6 1996/04/06 06:01:03 thorpej Exp $ */
/*
@@ -632,8 +632,8 @@ main(int argc, char **argv)
extern char *optarg;
extern int optind;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
while ((optchar = getopt(argc, argv, "vqf:")) != -1) {
switch (optchar) {
@@ -664,8 +664,8 @@ main(int argc, char **argv)
readunits(userfile);
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
if (argc == 3) {
strlcpy(havestr, argv[0], sizeof(havestr));
diff --git a/usr.bin/unvis/unvis.c b/usr.bin/unvis/unvis.c
index 924e88c8a90..22566d97512 100644
--- a/usr.bin/unvis/unvis.c
+++ b/usr.bin/unvis/unvis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unvis.c,v 1.13 2015/10/06 22:58:24 deraadt Exp $ */
+/* $OpenBSD: unvis.c,v 1.14 2015/10/09 01:37:09 deraadt Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -43,8 +43,8 @@ main(int argc, char *argv[])
FILE *fp;
int ch;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
@@ -66,8 +66,8 @@ main(int argc, char *argv[])
argv++;
}
else {
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
process(stdin, "<stdin>");
}
diff --git a/usr.bin/users/users.c b/usr.bin/users/users.c
index 2847815d174..8a8d13828de 100644
--- a/usr.bin/users/users.c
+++ b/usr.bin/users/users.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: users.c,v 1.12 2015/10/07 14:35:19 deraadt Exp $ */
+/* $OpenBSD: users.c,v 1.13 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: users.c,v 1.5 1994/12/20 15:58:19 jtc Exp $ */
/*
@@ -53,8 +53,8 @@ main(int argc, char *argv[])
struct utmp utmp;
int ch;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c
index 355917f3af9..a442fa9cac1 100644
--- a/usr.bin/uudecode/uudecode.c
+++ b/usr.bin/uudecode/uudecode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uudecode.c,v 1.21 2015/10/07 06:00:33 deraadt Exp $ */
+/* $OpenBSD: uudecode.c,v 1.22 2015/10/09 01:37:09 deraadt Exp $ */
/* $FreeBSD: uudecode.c,v 1.49 2003/05/03 19:44:46 obrien Exp $ */
/*-
@@ -127,11 +127,11 @@ main(int argc, char *argv[])
argv += optind;
if (oflag || pflag == 0) {
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
} else {
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
}
if (*argv) {
diff --git a/usr.bin/uuencode/uuencode.c b/usr.bin/uuencode/uuencode.c
index c3dfe3a79c5..f318854fb61 100644
--- a/usr.bin/uuencode/uuencode.c
+++ b/usr.bin/uuencode/uuencode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uuencode.c,v 1.12 2015/10/07 06:00:33 deraadt Exp $ */
+/* $OpenBSD: uuencode.c,v 1.13 2015/10/09 01:37:09 deraadt Exp $ */
/* $FreeBSD: uuencode.c,v 1.18 2004/01/22 07:23:35 grehan Exp $ */
/*-
@@ -99,11 +99,11 @@ main(int argc, char *argv[])
argc -= optind;
if (argc == 2 || outfile) {
- if (tame("stdio rpath wpath cpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
} else {
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
}
switch(argc) {
diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c
index 869660d3898..cf5cd8449c1 100644
--- a/usr.bin/vis/vis.c
+++ b/usr.bin/vis/vis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vis.c,v 1.18 2015/10/05 06:59:18 deraadt Exp $ */
+/* $OpenBSD: vis.c,v 1.19 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: vis.c,v 1.4 1994/12/20 16:13:03 jtc Exp $ */
/*-
@@ -55,8 +55,8 @@ main(int argc, char *argv[])
FILE *fp;
int ch;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "anwctsobfF:ld")) != -1)
switch(ch) {
@@ -118,8 +118,8 @@ main(int argc, char *argv[])
argv++;
}
else {
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
process(stdin);
}
exit(0);
diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c
index 8c1104e3bf4..cfeb9e4196d 100644
--- a/usr.bin/wc/wc.c
+++ b/usr.bin/wc/wc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wc.c,v 1.18 2015/10/03 14:39:25 deraadt Exp $ */
+/* $OpenBSD: wc.c,v 1.19 2015/10/09 01:37:09 deraadt Exp $ */
/*
* Copyright (c) 1980, 1987, 1991, 1993
@@ -57,8 +57,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
while ((ch = getopt(argc, argv, "lwchm")) != -1)
switch(ch) {
diff --git a/usr.bin/what/what.c b/usr.bin/what/what.c
index 7442b26288c..d22d67387b0 100644
--- a/usr.bin/what/what.c
+++ b/usr.bin/what/what.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: what.c,v 1.14 2015/10/06 13:47:08 deraadt Exp $ */
+/* $OpenBSD: what.c,v 1.15 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: what.c,v 1.4 1994/12/20 16:01:03 jtc Exp $ */
/*
@@ -58,8 +58,8 @@ main(int argc, char *argv[])
char match[256];
int c;
- if (tame("stdio rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
matches = sflag = 0;
while ((c = getopt(argc, argv, "s")) != -1) {
diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c
index 0bf8b179669..b409e541a99 100644
--- a/usr.bin/who/who.c
+++ b/usr.bin/who/who.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: who.c,v 1.22 2015/10/07 17:27:35 semarie Exp $ */
+/* $OpenBSD: who.c,v 1.23 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: who.c,v 1.4 1994/12/07 04:28:49 jtc Exp $ */
/*
@@ -74,8 +74,8 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- if (tame("stdio getpw rpath tty", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw rpath tty", NULL) == -1)
+ err(1, "pledge");
mytty = ttyname(0);
/* strip any directory component */
@@ -290,11 +290,11 @@ file(char *name)
/* NOTREACHED */
}
if (show_term || show_idle) {
- if (tame("stdio getpw rpath", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw rpath", NULL) == -1)
+ err(1, "pledge");
} else {
- if (tame("stdio getpw", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio getpw", NULL) == -1)
+ err(1, "pledge");
}
return(ufp);
}
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index a88660c757b..342b965e3e0 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: whois.c,v 1.49 2015/10/03 01:33:20 deraadt Exp $ */
+/* $OpenBSD: whois.c,v 1.50 2015/10/09 01:37:09 deraadt Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -138,8 +138,8 @@ main(int argc, char *argv[])
if (!argc || (country != NULL && host != NULL))
usage();
- if (tame("stdio dns inet", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio dns inet", NULL) == -1)
+ err(1, "pledge");
if (host == NULL && country == NULL && !(flags & WHOIS_QUICK))
flags |= WHOIS_RECURSE;
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c
index d239d27482c..ffbe8a8681f 100644
--- a/usr.bin/write/write.c
+++ b/usr.bin/write/write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: write.c,v 1.30 2015/10/06 03:25:02 deraadt Exp $ */
+/* $OpenBSD: write.c,v 1.31 2015/10/09 01:37:09 deraadt Exp $ */
/* $NetBSD: write.c,v 1.5 1995/08/31 21:48:32 jtc Exp $ */
/*
@@ -250,8 +250,8 @@ do_write(char *tty, char *mytty, uid_t myuid)
* Unfortunately this is rather late - well after utmp
* parsing, then pinned by the tty open and setresgid
*/
- if (tame("stdio", NULL) == -1)
- err(1, "tame");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
(void)signal(SIGINT, done);
(void)signal(SIGHUP, done);