From: deraadt Date: Wed, 7 Oct 2015 14:10:50 +0000 (+0000) Subject: tame "stdio rpath", which covers readlink() and realpath() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=70e241c8f93896d59812d3d3d63b8e8ea5d2654e;p=openbsd tame "stdio rpath", which covers readlink() and realpath() ok semarie --- 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':