From 56b85e035b77e48e7ec241b54da3f9c9d19e77d5 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 5 Nov 2009 16:48:09 -0700 Subject: build: consistently use freopen-safer cat, head, ptx, shuf, tac, tail, tee, tr, and uniq used freopen on stdout, and were potentially vulnerable. dircolors, du, and tsort only used it on stdin, which is unaffected by freopen_safer, but this covers all uses for consistency. * cfg.mk (sc_require_stdio_safer): New rule. * gl/modules/xfreopen (Depends-on): Add freopen-safer. * gl/lib/xfreopen.c (includes): Use stdio--.h. * src/ptx.c (includes): Likewise. * src/shuf.c (includes): Likewise. * src/uniq.c (includes): Likewise. * src/dircolors.c (includes): Likewise. * src/du.c (includes): Likewise. * src/tsort.c (includes): Likewise. --- gl/lib/xfreopen.c | 1 + gl/modules/xfreopen | 1 + 2 files changed, 2 insertions(+) (limited to 'gl') diff --git a/gl/lib/xfreopen.c b/gl/lib/xfreopen.c index 61091694b..32e68fa35 100644 --- a/gl/lib/xfreopen.c +++ b/gl/lib/xfreopen.c @@ -21,6 +21,7 @@ #include "error.h" #include "exitfail.h" #include "quote.h" +#include "stdio--.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/gl/modules/xfreopen b/gl/modules/xfreopen index 411f80bbd..ed4ede75a 100644 --- a/gl/modules/xfreopen +++ b/gl/modules/xfreopen @@ -8,6 +8,7 @@ lib/xfreopen.h Depends-on: error exitfail +freopen-safer quote configure.ac: -- cgit v1.2.3-70-g09d2