summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>1999-04-24 22:16:06 +0000
committerSascha Schumann <sas@php.net>1999-04-24 22:16:06 +0000
commita156a47187a7f75b530c66e3fd17f43b554fbfdb (patch)
tree7d2e40e50c563122e8bce629048b17196ee791fa /scripts
parent2d78e4779e9a8aa570e4b1423d48855a93ca4018 (diff)
downloadphp-git-a156a47187a7f75b530c66e3fd17f43b554fbfdb.tar.gz
security check and disclaimer for generated files
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/preconfig14
1 files 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