summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-10-07 06:51:50 +0000
committerderaadt <deraadt@openbsd.org>2015-10-07 06:51:50 +0000
commita00abc66f59cca0716f60743016c18bb5287569d (patch)
tree62fffe87d35d0cc1ff813305f2f9072487220a8e
parenttame "stdio rpath wpath cpath tmppath tty". "tty" is the important part (diff)
downloadwireguard-openbsd-a00abc66f59cca0716f60743016c18bb5287569d.tar.xz
wireguard-openbsd-a00abc66f59cca0716f60743016c18bb5287569d.zip
tame "stdio rpath getpw" before getpwuid and opening, then tame "stdio"
-rw-r--r--usr.bin/from/from.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c
index baf26f4ae30..f6ecef03539 100644
--- a/usr.bin/from/from.c
+++ b/usr.bin/from/from.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: from.c,v 1.20 2015/06/03 18:08:54 millert Exp $ */
+/* $OpenBSD: from.c,v 1.21 2015/10/07 06:51:50 deraadt Exp $ */
/* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */
/*
@@ -74,12 +74,16 @@ main(int argc, char *argv[])
}
argv += optind;
+ if (tame("stdio rpath getpw", NULL) == -1)
+ err(1, "tame");
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");
for (newline = 1; (linelen = getline(&line, &linesize, fp)) != -1;) {
if (*line == '\n') {
newline = 1;