diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-03 01:07:16 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-03 01:07:16 +0000 |
commit | 0e973d5335bc28d897ab9da505d131167dbd3d77 (patch) | |
tree | 27c3032dc3d2586eeae22dbb6556c1534b3ca939 | |
parent | 808b804cc8eedb70c7ae19e9bc4c9fd218fcc8e7 (diff) |
even before it reaches getopt(), this program will never do more than
talk to stdio. tame "stdio" is a no-brainer.
reviewed a while ago by doug
-rw-r--r-- | usr.bin/basename/basename.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/basename/basename.c b/usr.bin/basename/basename.c index add243864d3..bcdaf532103 100644 --- a/usr.bin/basename/basename.c +++ b/usr.bin/basename/basename.c @@ -1,4 +1,4 @@ -/* $OpenBSD: basename.c,v 1.9 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: basename.c,v 1.10 2015/10/03 01:07:15 deraadt Exp $ */ /* $NetBSD: basename.c,v 1.9 1995/09/02 05:29:46 jtc Exp $ */ /*- @@ -48,6 +48,9 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); + if (tame("stdio", NULL) == -1) + err(1, "tame"); + while ((ch = getopt(argc, argv, "")) != -1) { switch (ch) { default: |