From 1a2cc46934663795de56cc28eee9b5351edead75 Mon Sep 17 00:00:00 2001 From: Martin Zobel-Helas Date: Sun, 17 Jun 2012 12:41:45 +0200 Subject: [PATCH] LoadModule and LoadFile are not permited Signed-off-by: Martin Zobel-Helas --- apache2-vhost-update | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apache2-vhost-update b/apache2-vhost-update index 5bddf71..24d59c8 100755 --- a/apache2-vhost-update +++ b/apache2-vhost-update @@ -122,6 +122,20 @@ if grep -i include "$DESTINATION/$site" > /dev/null; then exit 1 fi +if grep -i LoadModule "$DESTINATION/$site" > /dev/null; then + echo "New site may have LoadModule statements - rejecting." >&2 + rm -f "$DESTINATION/$site" + co "$DESTINATION/$site" + exit 1 +fi + +if grep -i LoadFile "$DESTINATION/$site" > /dev/null; then + echo "New site may have LoadFile 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 -- 2.30.2