From e435400885c7061bd5eab8936773b8f347b97a62 Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Fri, 15 Jul 2016 14:18:49 +0200 Subject: [PATCH] Nacin aktivacije ModSecurity u debian/postinst. --- debian/changelog | 6 ++++++ debian/postinst | 26 +++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index c449fc9..1add040 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mod-security-cn (2.8.0+2) stable; urgency=low + + * Nacin aktivacije ModSecurity modula u debian/postinst. + + -- Dragan Dosen Fri, 15 Jul 2016 14:11:23 +0200 + mod-security-cn (2.8.0+1) stable; urgency=low * Prva inacica paketa za Debian jessie distribuciju. diff --git a/debian/postinst b/debian/postinst index 2f61213..fd77bf0 100644 --- a/debian/postinst +++ b/debian/postinst @@ -43,7 +43,6 @@ if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then . /usr/share/apache2/apache2-maintscript-helper modsecurity_enable() { - cp_echo "CN: Enabling $PKG configuration for Apache2." return 0 } else @@ -97,6 +96,13 @@ chk_conf_tag () { trap cleanup 0 1 2 15 +# Enable ModSecurity and unique_id Apache2 modules. +# +if modsecurity_enable; then + apache2_invoke enmod security2 +fi + + # Remove obsolete symbolic link. # if [ "`readlink -q -m /etc/apache2/conf.d/$PKG.conf`" = "$MODSECCONF" ]; then @@ -183,15 +189,17 @@ if [ $RET -eq 0 ] || [ $RET -eq 1 ]; then fi if [ -f "$out" ]; then rm -f $out; fi +fi - # Enable ModSecurity configuration. - if [ ! -e "$MODSECLNK" ]; then - ln -fs "$MODSECCONF" "$MODSECLNK" - fi - if modsecurity_enable; then - apache2_invoke enmod security2 - apache2_invoke enconf security2-cn - fi + +# Enable ModSecurity configuration. +# +if [ ! -e "$MODSECLNK" ]; then + ln -fs "$MODSECCONF" "$MODSECLNK" +fi +if modsecurity_enable; then + cp_echo "CN: Enabling $PKG configuration for Apache2." + apache2_invoke enconf security2-cn fi db_stop || true -- 1.7.10.4