diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-05 13:27:46 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-05 13:27:46 +0000 |
commit | da8b794f1a034a35fd3254d7ba14f02e02ffbe5f (patch) | |
tree | 358bfbbd350ae29d28fc4da598f05c0031616a5e | |
parent | 684fe650d7dcc2bb24bfbbb9586149f8bd6ad1c7 (diff) |
This can use tame "stdio rpath" from the top. If we are only working on
stdin, an additional tame "stdio" is easy.
same diff from sthen
-rw-r--r-- | usr.bin/cut/cut.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c index 97322c15e02..2f14ce08dd3 100644 --- a/usr.bin/cut/cut.c +++ b/usr.bin/cut/cut.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cut.c,v 1.19 2015/08/18 17:10:48 deraadt Exp $ */ +/* $OpenBSD: cut.c,v 1.20 2015/10/05 13:27:45 deraadt Exp $ */ /* $NetBSD: cut.c,v 1.9 1995/09/02 05:59:23 jtc Exp $ */ /* @@ -63,6 +63,9 @@ main(int argc, char *argv[]) setlocale (LC_ALL, ""); + if (tame("stdio rpath", NULL) == -1) + err(1, "tame"); + dchar = '\t'; /* default delimiter is \t */ /* Since we don't support multi-byte characters, the -c and -b @@ -117,8 +120,11 @@ main(int argc, char *argv[]) } } } - else + else { + if (tame("stdio rpath", NULL) == -1) + err(1, "tame"); fcn(stdin, "stdin"); + } exit(rval); } |