chiark / gitweb /
Do not allow include statements in sites
[dsa-metapackages.git] / apache2-vhost-update
index 61c5bf3..a61369e 100755 (executable)
@@ -112,8 +112,16 @@ if [ "$?" != "0" ]; then
        echo "Could not get a lock/checkout $DESTINATION/$site." >&2
        exit 1
 fi
        echo "Could not get a lock/checkout $DESTINATION/$site." >&2
        exit 1
 fi
+
 cp -f "$STATINGDIR/$site" "$DESTINATION/$site"
 
 cp -f "$STATINGDIR/$site" "$DESTINATION/$site"
 
+if grep -i include "$DESTINATION/$site" > /dev/null; then
+       echo "New site may have include statements - rejecting." >&2
+       rm -f "$DESTINATION/$site"
+       co "$DESTINATION/$site"
+       exit 1
+fi
+
 /usr/sbin/apache2ctl configtest
 if [ "$?" != "0" ]; then
        echo "configtest returned errors; reverting." >&2
 /usr/sbin/apache2ctl configtest
 if [ "$?" != "0" ]; then
        echo "configtest returned errors; reverting." >&2