From owner-freebsd-ports-bugs@freebsd.org Tue Oct 6 09:43:08 2015 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F5819D0D9C for ; Tue, 6 Oct 2015 09:43:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B101C7 for ; Tue, 6 Oct 2015 09:43:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t969h8e3015604 for ; Tue, 6 Oct 2015 09:43:08 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 203454] patch for www/mod_evasive (unbreaks port) Date: Tue, 06 Oct 2015 09:43:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: w.litter@aon.at X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-ports-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2015 09:43:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D203454 --- Comment #2 from Walter Schwarzenfeld --- Comment on attachment 161575 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D161575 mod_evasive.diff >Index: Makefile >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- Makefile (revision 398216) >+++ Makefile (working copy) >@@ -3,13 +3,13 @@ >=20 > PORTNAME=3D mod_evasive > PORTVERSION=3D 1.10.1 >-PORTREVISION=3D 1 >+PORTREVISION=3D 2 > CATEGORIES=3D www security > MASTER_SITES=3D http://www.zdziarski.com/blog/wp-content/uploads/2010/02/ > DISTNAME=3D mod_evasive_${PORTVERSION} > DIST_SUBDIR=3D apache2 >=20 >-MAINTAINER=3D kiwi@oav.net >+MAINTAINER=3D w.litter@aon.at > COMMENT=3D Apache module to try to protect the HTTP Server from DoS/DDoS = attacks >=20 > LICENSE=3D GPLv2 >@@ -16,7 +16,7 @@ >=20 > WRKSRC=3D ${WRKDIR}/${PORTNAME} >=20 >-USE_APACHE=3D 22 >+USE_APACHE=3D 22+ > AP_FAST_BUILD=3D yes > AP_GENPLIST=3D yes > MODULENAME=3D ${PORTNAME}20 >Index: files/patch-mod_evasive20.c >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- files/patch-mod_evasive20.c (revision 0) >+++ files/patch-mod_evasive20.c (working copy) >@@ -0,0 +1,102 @@ >+--- mod_evasive20.c.orig 2015-07-05 17:29:09 UTC >++++ mod_evasive20.c >+@@ -115,6 +115,7 @@ static void * create_hit_list(apr_pool_t >+ /* Create a new hit list for this listener */ >+=20 >+ hit_list =3D ntt_create(hash_table_size); >++ return 0;=09 >+ } >+=20 >+ static const char *whitelist(cmd_parms *cmd, void *dconfig, const char *= ip) >+@@ -139,11 +140,11 @@ static int access_checker(request_rec *r >+ time_t t =3D time(NULL); >+=20 >+ /* Check whitelist */ >+- if (is_whitelisted(r->connection->remote_ip))=20 >++ if (is_whitelisted(r->connection->client_ip))=20 >+ return OK; >+=20 >+ /* First see if the IP itself is on "hold" */ >+- n =3D ntt_find(hit_list, r->connection->remote_ip); >++ n =3D ntt_find(hit_list, r->connection->client_ip); >+=20 >+ if (n !=3D NULL && t-n->timestamp+=20=20 >+@@ -155,14 +156,14 @@ static int access_checker(request_rec *r >+ } else { >+=20 >+ /* Has URI been hit too much? */ >+- snprintf(hash_key, 2048, "%s_%s", r->connection->remote_ip, r->u= ri); >++ snprintf(hash_key, 2048, "%s_%s", r->connection->client_ip, r->u= ri); >+ n =3D ntt_find(hit_list, hash_key); >+ if (n !=3D NULL) { >+=20 >+ /* If URI is being hit too much, add to "hold" list and 403 */ >+ if (t-n->timestampcount>=3Dpage_count) { >+ ret =3D HTTP_FORBIDDEN; >+- ntt_insert(hit_list, r->connection->remote_ip, time(NULL)); >++ ntt_insert(hit_list, r->connection->client_ip, time(NULL)); >+ } else { >+=20 >+ /* Reset our hit count list as necessary */ >+@@ -177,14 +178,14 @@ static int access_checker(request_rec *r >+ } >+=20 >+ /* Has site been hit too much? */ >+- snprintf(hash_key, 2048, "%s_SITE", r->connection->remote_ip); >++ snprintf(hash_key, 2048, "%s_SITE", r->connection->client_ip); >+ n =3D ntt_find(hit_list, hash_key); >+ if (n !=3D NULL) { >+=20 >+ /* If site is being hit too much, add to "hold" list and 403 */ >+ if (t-n->timestampcount>=3Dsite_count) { >+ ret =3D HTTP_FORBIDDEN; >+- ntt_insert(hit_list, r->connection->remote_ip, time(NULL)); >++ ntt_insert(hit_list, r->connection->client_ip, time(NULL)); >+ } else { >+=20 >+ /* Reset our hit count list as necessary */ >+@@ -204,28 +205,29 @@ static int access_checker(request_rec *r >+ char filename[1024]; >+ struct stat s; >+ FILE *file; >++ int getpid(); >+=20 >+- snprintf(filename, sizeof(filename), "%s/dos-%s", log_dir !=3D N= ULL ? log_dir : DEFAULT_LOG_DIR, r->connection->remote_ip); >++ snprintf(filename, sizeof(filename), "%s/dos-%s", log_dir !=3D N= ULL ? log_dir : DEFAULT_LOG_DIR, r->connection->client_ip); >+ if (stat(filename, &s)) { >+ file =3D fopen(filename, "w"); >+ if (file !=3D NULL) { >+- fprintf(file, "%ld\n", getpid()); >++ fprintf(file, "%d\n", getpid()); >+ fclose(file); >+=20 >+- LOG(LOG_ALERT, "Blacklisting address %s: possible DoS attack= .", r->connection->remote_ip); >++ LOG(LOG_ALERT, "Blacklisting address %s: possible DoS attack= .", r->connection->client_ip); >+ if (email_notify !=3D NULL) { >+ snprintf(filename, sizeof(filename), MAILER, email_notify); >+ file =3D popen(filename, "w"); >+ if (file !=3D NULL) { >+ fprintf(file, "To: %s\n", email_notify); >+- fprintf(file, "Subject: HTTP BLACKLIST %s\n\n", r->conne= ction->remote_ip); >+- fprintf(file, "mod_evasive HTTP Blacklisted %s\n", r->co= nnection->remote_ip); >++ fprintf(file, "Subject: HTTP BLACKLIST %s\n\n", r->conne= ction->client_ip); >++ fprintf(file, "mod_evasive HTTP Blacklisted %s\n", r->co= nnection->client_ip); >+ pclose(file); >+ } >+ } >+=20 >+ if (system_command !=3D NULL) { >+- snprintf(filename, sizeof(filename), system_command, r->co= nnection->remote_ip); >++ snprintf(filename, sizeof(filename), system_command, r->co= nnection->client_ip); >+ system(filename); >+ } >+=20=20 >+@@ -298,6 +300,7 @@ static apr_status_t destroy_hit_list(voi >+ ntt_destroy(hit_list); >+ free(email_notify); >+ free(system_command); >++ return 0; >+ } >+=20 >+=20 > >Property changes on: files/patch-mod_evasive20.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property --=20 You are receiving this mail because: You are the assignee for the bug.=