summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-07 03:49:42 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-07 03:49:42 +0000
commit0ce254c15a6bc80bb5fbb3725cba83f53d48a1c7 (patch)
tree2b32bc332d4f0ad60c185ab869d8c8ac90e5d6ec /usr.bin
parent6a022364a836d2d8faa0dc6d271cf5e0d35fac1b (diff)
tame "stdio rpath" for when paths are specified; otherwise tame "stdio"
for the stdin case. ok doug
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tail/tail.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c
index 5a1727b35af..41eca1594be 100644
--- a/usr.bin/tail/tail.c
+++ b/usr.bin/tail/tail.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tail.c,v 1.17 2009/10/27 23:59:44 deraadt Exp $ */
+/* $OpenBSD: tail.c,v 1.18 2015/10/07 03:49:41 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -61,6 +61,9 @@ main(int argc, char *argv[])
int ch, first;
char *p;
+ if (tame("stdio rpath", NULL) == -1)
+ err(1, "tame");
+
/*
* Tail's options are weird. First, -n10 is the same as -n-10, not
* -n+10. Second, the number options are 1 based and not offsets,
@@ -171,6 +174,9 @@ main(int argc, char *argv[])
(void)fclose(fp);
}
else {
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
+
fname = "stdin";
is_stdin = 1;