diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-07-14 17:09:30 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-07-14 17:09:30 +0000 |
commit | 27bbc5d6c15f5e6a8ec27a9330fc05b4fb365198 (patch) | |
tree | 12e7552b091bfe6621bfaaf6ff01d670d06177c8 /www-apache/mod_security | |
parent | Version bump (diff) | |
download | gentoo-2-27bbc5d6c15f5e6a8ec27a9330fc05b4fb365198.tar.gz gentoo-2-27bbc5d6c15f5e6a8ec27a9330fc05b4fb365198.tar.bz2 gentoo-2-27bbc5d6c15f5e6a8ec27a9330fc05b4fb365198.zip |
Add patch to properly build with --as-needed (thanks to Christian Ruppert in bug #276272 — this required an extra fix to the autotools); add a perl USE flag to disable the update script and add the libwww-perl dependency (thanks again to Christian in bug #275864), and add a notice about the draconic command injection rule (bug #223815 reported by David Sommerseth.
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'www-apache/mod_security')
4 files changed, 164 insertions, 1 deletions
diff --git a/www-apache/mod_security/ChangeLog b/www-apache/mod_security/ChangeLog index 3f540c917704..44c40181fbe1 100644 --- a/www-apache/mod_security/ChangeLog +++ b/www-apache/mod_security/ChangeLog @@ -1,6 +1,18 @@ # ChangeLog for www-apache/mod_security # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_security/ChangeLog,v 1.22 2009/06/14 10:22:26 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_security/ChangeLog,v 1.23 2009/07/14 17:09:29 flameeyes Exp $ + +*mod_security-2.5.9-r1 (14 Jul 2009) + + 14 Jul 2009; Diego E. Pettenò <flameeyes@gentoo.org> + +mod_security-2.5.9-r1.ebuild, +files/mod_security-2.5.9-as-needed.patch, + files/mod_security-2.5.9-broken-autotools.patch: + Add patch to properly build with --as-needed (thanks to Christian Ruppert + in bug #276272 — this required an extra fix to the autotools); add a + perl USE flag to disable the update script and add the libwww-perl + dependency (thanks again to Christian in bug #275864), and add a notice + about the draconic command injection rule (bug #223815 reported by David + Sommerseth. 14 Jun 2009; Diego E. Pettenò <flameeyes@gentoo.org> metadata.xml: Add myself as maintainer too since I haven't seen Luca in a while. diff --git a/www-apache/mod_security/files/mod_security-2.5.9-as-needed.patch b/www-apache/mod_security/files/mod_security-2.5.9-as-needed.patch new file mode 100644 index 000000000000..77d093c140cc --- /dev/null +++ b/www-apache/mod_security/files/mod_security-2.5.9-as-needed.patch @@ -0,0 +1,26 @@ +diff -Naurp -Naurp modsecurity-apache_2.5.9.old/apache2/Makefile.in modsecurity-apache_2.5.9/apache2/Makefile.in +--- modsecurity-apache_2.5.9.old/apache2/Makefile.in 2009-07-02 19:18:31.000000000 +0200 ++++ modsecurity-apache_2.5.9/apache2/Makefile.in 2009-07-02 19:48:23.000000000 +0200 +@@ -52,11 +52,11 @@ APU_LIBS = @APU_LIBS@ + APU_LINK_LD = @APU_LINK_LD@ + + CPPFLAGS = @CPPFLAGS@ $(PCRE_CFLAGS) $(LIBXML_CFLAGS) $(LUA_CFLAGS) +-LIBS = @LIBS@ $(PCRE_LIBS) $(LIBXML_LIBS) $(LUA_LIBS) ++LIBS = @LIBS@ $(PCRE_LIBS) $(LIBXML_LIBS) $(LUA_LIBS) $(APXS_LIBS) $(APR_LIBS) $(APR_LINK_LD) $(APU_LIBS) $(APU_LINK_LD) + LDFLAGS = @LDFLAGS@ + CFLAGS = @CFLAGS@ + +-COMPILE_APACHE_MOD = $(APXS_WRAPPER) -c $(CPPFLAGS) $(LDFLAGS) $(LIBS) ++COMPILE_APACHE_MOD = $(APXS_WRAPPER) -c $(CPPFLAGS) $(LDFLAGS) + + INSTALL_MOD_SHARED = $(APXS_WRAPPER) -i + +@@ -93,7 +93,7 @@ mod_security2.la: $(MOD_SECURITY2_H) *.c + src="$$src $$f.c"; \ + done; \ + rm -f msc_test msc_test.o msc_test.lo msc_test.slo; \ +- $(COMPILE_APACHE_MOD) $(APXS_EXTRA_CFLAGS) $(MODSEC_APXS_EXTRA_CFLAGS) $$src ++ $(COMPILE_APACHE_MOD) $(APXS_EXTRA_CFLAGS) $(MODSEC_APXS_EXTRA_CFLAGS) $$src $(LIBS) + + ### MLogC + mlogc: diff --git a/www-apache/mod_security/files/mod_security-2.5.9-broken-autotools.patch b/www-apache/mod_security/files/mod_security-2.5.9-broken-autotools.patch index 75cbb4600f60..4ef1960d6535 100644 --- a/www-apache/mod_security/files/mod_security-2.5.9-broken-autotools.patch +++ b/www-apache/mod_security/files/mod_security-2.5.9-broken-autotools.patch @@ -32,3 +32,16 @@ Index: modsecurity-apache_2.5.9/apache2/build/find_apu.m4 fi dnl # Look for the config script +Index: modsecurity-apache_2.5.9/apache2/configure.in +=================================================================== +--- modsecurity-apache_2.5.9.orig/apache2/configure.in ++++ modsecurity-apache_2.5.9/apache2/configure.in +@@ -247,7 +247,7 @@ VERSION_OK + if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apxs LIBDIR: $APXS_LIBDIR); fi + # Make sure the lib dir is used + if test -n "$APXS_LIBDIR"; then +- APXS_LIBS="-L{$APXS_LIBDIR} `$APXS -q LIBS` `$APXS -q EXTRA_LIBS`" ++ APXS_LIBS="-L${APXS_LIBDIR} `$APXS -q LIBS` `$APXS -q EXTRA_LIBS`" + else + APXS_LIBS="`$APXS -q LIBS` `$APXS -q EXTRA_LIBS`" + fi diff --git a/www-apache/mod_security/mod_security-2.5.9-r1.ebuild b/www-apache/mod_security/mod_security-2.5.9-r1.ebuild new file mode 100644 index 000000000000..065484a61cce --- /dev/null +++ b/www-apache/mod_security/mod_security-2.5.9-r1.ebuild @@ -0,0 +1,112 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_security/mod_security-2.5.9-r1.ebuild,v 1.1 2009/07/14 17:09:29 flameeyes Exp $ + +inherit apache-module autotools + +MY_P=${P/mod_security-/modsecurity-apache_} +MY_P=${MY_P/_rc/-rc} + +DESCRIPTION="Web application firewall and Intrusion Detection System for Apache." +HOMEPAGE="http://www.modsecurity.org/" +SRC_URI="http://www.modsecurity.org/download/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~mips ~ppc ~sparc ~x86" +IUSE="lua perl" + +DEPEND="dev-libs/libxml2 + perl? ( dev-perl/libwww-perl ) + lua? ( >=dev-lang/lua-5.1 )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +APACHE2_MOD_FILE="apache2/.libs/${PN}2.so" +APACHE2_MOD_CONF="2.1.2/99_mod_security" +APACHE2_MOD_DEFINE="SECURITY" + +need_apache2 + +src_unpack() { + unpack ${A} + + cd "${S}"/apache2 + + epatch "${FILESDIR}"/${P}-broken-autotools.patch + epatch "${FILESDIR}"/${P}-as-needed.patch + + eautoreconf +} + +src_compile() { + cd apache2 + + econf --with-apxs="${APXS}" \ + --without-curl \ + $(use_with lua) \ + || die "econf failed" + + APXS_FLAGS= + for flag in ${CFLAGS}; do + APXS_FLAGS="${APXS_FLAGS} -Wc,${flag}" + done + + # Yes we need to prefix it _twice_ + for flag in ${LDFLAGS}; do + APXS_FLAGS="${APXS_FLAGS} -Wl,${flag}" + done + + emake \ + APXS_CFLAGS="${CFLAGS}" \ + APXS_LDFLAGS="${LDFLAGS}" \ + APXS_EXTRA_CFLAGS="${APXS_FLAGS}" \ + || die "emake failed" +} + +src_test() { + cd apache2 + make test || die +} + +src_install() { + apache-module_src_install + + # install rules updater only if perl is enabled (optionally) + if use perl; then + newbin tools/rules-updater.pl modsec-rules-updater || die + fi + + # install documentation + dodoc CHANGES || die + newdoc rules/CHANGELOG CHANGES.crs || die + newdoc rules/README README.crs || die + dohtml -r doc/* || die + + # Prepare the core ruleset + cd "${S}"/rules/ + + sed -i -e 's:logs/:/var/log/apache2/:g' *.conf || die + + insinto ${APACHE_MODULES_CONFDIR}/mod_security/ + for i in *.conf; do + newins ${i} ${i/modsecurity_crs_/} || die + done +} + +pkg_postinst() { + elog "Please note that the core rule set distributed with mod_security is quite" + elog "draconic. If you're using this on a blog, a forum or another user-submitted" + elog "web application where you might talk about standard Unix paths (such as /etc" + elog "or /bin), you might want to disable at least rule 950005 (command injection)" + elog "if you're sure it might not be a security risk." + elog " " + elog "To do that on the most limited case you might want to use something like" + elog "the following code (this comes from a Typo weblog instance):" + elog " " + elog " <Location /comments>" + elog " SecRuleRemoveById 950005" + elog " </Location>" + elog " " +} |