From: deraadt Date: Wed, 7 Oct 2015 03:50:10 +0000 (+0000) Subject: tame "stdio rpath wpath cpath" to cover all the file opening cases. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=00548c463299456d227600c0a0b591bbc4ab7c74;p=openbsd tame "stdio rpath wpath cpath" to cover all the file opening cases. ok doug --- diff --git a/usr.bin/csplit/csplit.c b/usr.bin/csplit/csplit.c index 56dc28c749a..c11bbba620d 100644 --- a/usr.bin/csplit/csplit.c +++ b/usr.bin/csplit/csplit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: csplit.c,v 1.5 2014/05/20 01:25:23 guenther Exp $ */ +/* $OpenBSD: csplit.c,v 1.6 2015/10/07 03:50:10 deraadt Exp $ */ /* $FreeBSD: src/usr.bin/csplit/csplit.c,v 1.9 2004/03/22 11:15:03 tjr Exp $ */ /*- @@ -103,6 +103,9 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); + if (tame("stdio rpath wpath cpath", NULL) == -1) + err(1, "tame"); + kflag = sflag = 0; prefix = "xx"; sufflen = 2; @@ -140,6 +143,8 @@ main(int argc, char *argv[]) if (strcmp(infn, "-") == 0) { infile = stdin; infn = "stdin"; + if (tame("stdio wpath cpath", NULL) == -1) + err(1, "tame"); } else if ((infile = fopen(infn, "r")) == NULL) err(1, "%s", infn);