summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-10-07 14:10:50 +0000
committerderaadt <deraadt@openbsd.org>2015-10-07 14:10:50 +0000
commit70e241c8f93896d59812d3d3d63b8e8ea5d2654e (patch)
tree61c75bdd953b61ee844753ca1f787245d4fb8aa6
parenttame "stdio"; username information does not use getpw (diff)
downloadwireguard-openbsd-70e241c8f93896d59812d3d3d63b8e8ea5d2654e.tar.xz
wireguard-openbsd-70e241c8f93896d59812d3d3d63b8e8ea5d2654e.zip
tame "stdio rpath", which covers readlink() and realpath()
ok semarie
-rw-r--r--usr.bin/readlink/readlink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/readlink/readlink.c b/usr.bin/readlink/readlink.c
index 83c3a25c12a..a5a0445283a 100644
--- a/usr.bin/readlink/readlink.c
+++ b/usr.bin/readlink/readlink.c
@@ -1,5 +1,5 @@
/*
- * $OpenBSD: readlink.c,v 1.25 2009/05/01 10:36:48 chl Exp $
+ * $OpenBSD: readlink.c,v 1.26 2015/10/07 14:10:50 deraadt Exp $
*
* Copyright (c) 1997
* Kenneth Stailey (hereinafter referred to as the author)
@@ -44,6 +44,9 @@ main(int argc, char *argv[])
int n, ch, nflag = 0, fflag = 0;
extern int optind;
+ if (tame("stdio rpath", NULL) == -1)
+ err(1, "tame");
+
while ((ch = getopt(argc, argv, "fn")) != -1)
switch (ch) {
case 'f':