From a156a47187a7f75b530c66e3fd17f43b554fbfdb Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sat, 24 Apr 1999 22:16:06 +0000 Subject: [PATCH] security check and disclaimer for generated files --- scripts/preconfig | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/preconfig b/scripts/preconfig index a1af801e8b..d088de5a57 100755 --- a/scripts/preconfig +++ b/scripts/preconfig @@ -2,8 +2,17 @@ # # $Id$ +disclaimer="Do NOT edit - this file is generated by preconfig" + +# security check - simply overwriting existing files could be harmful +if test -e configure.in.new || test -e acconfig.h.new ; then + echo "Please remove the *.new files and rerun this command" + exit 1 +fi + makefiles=`echo ext/*/Makefile.am | sed -e 's/\.am//g'` -sed -e "s#@@EXT_MAKEFILES@@#$makefiles#" configure.in.in > configure.in.new +echo "dnl $disclaimer" > configure.in.new +sed -e "s#@@EXT_MAKEFILES@@#$makefiles#" configure.in.in >> configure.in.new cmp configure.in configure.in.new > /dev/null 2>&1 if test $? -ne 0 ; then mv configure.in.new configure.in @@ -11,7 +20,8 @@ else rm -f configure.in.new fi -cat acconfig.h.in > acconfig.h.new +echo "/* $disclaimer */" > acconfig.h.new +cat acconfig.h.in >> acconfig.h.new confighfiles=`echo ext/*/config.h.stub` if test "$confighfiles" != "ext/*/config.h.stub"; then for file in $confighfiles; do -- 2.50.1