From owner-freebsd-ports-bugs@freebsd.org Fri Jul 3 17:57:26 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 3DBB0994319 for ; Fri, 3 Jul 2015 17:57:26 +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 226531CC0 for ; Fri, 3 Jul 2015 17:57:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t63HvQqT043932 for ; Fri, 3 Jul 2015 17:57:26 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 201306] patch for www/mod_evasive Date: Fri, 03 Jul 2015 17:57:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new 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 Many People 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: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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: Fri, 03 Jul 2015 17:57:26 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201306 Bug ID: 201306 Summary: patch for www/mod_evasive Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: Individual Port(s) Assignee: freebsd-ports-bugs@FreeBSD.org Reporter: w.litter@aon.at CC: kiwi@oav.net CC: kiwi@oav.net Flags: maintainer-feedback?(kiwi@oav.net) This is no update, but will unbreak this port: patch-mod_evasive20.c --- mod_evasive20.c.orig 2015-07-03 17:42:29 UTC +++ mod_evasive20.c @@ -139,11 +139,11 @@ static int access_checker(request_rec *r time_t t = time(NULL); /* Check whitelist */ - if (is_whitelisted(r->connection->remote_ip)) + if (is_whitelisted(r->connection->client_ip)) return OK; /* First see if the IP itself is on "hold" */ - n = ntt_find(hit_list, r->connection->remote_ip); + n = ntt_find(hit_list, r->connection->client_ip); if (n != NULL && t-n->timestampconnection->remote_ip, r->uri); + snprintf(hash_key, 2048, "%s_%s", r->connection->client_ip, r->uri); n = ntt_find(hit_list, hash_key); if (n != NULL) { /* If URI is being hit too much, add to "hold" list and 403 */ if (t-n->timestampcount>=page_count) { ret = HTTP_FORBIDDEN; - ntt_insert(hit_list, r->connection->remote_ip, time(NULL)); + ntt_insert(hit_list, r->connection->client_ip, time(NULL)); } else { /* Reset our hit count list as necessary */ @@ -177,14 +177,14 @@ static int access_checker(request_rec *r } /* 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 = ntt_find(hit_list, hash_key); if (n != NULL) { /* If site is being hit too much, add to "hold" list and 403 */ if (t-n->timestampcount>=site_count) { ret = HTTP_FORBIDDEN; - ntt_insert(hit_list, r->connection->remote_ip, time(NULL)); + ntt_insert(hit_list, r->connection->client_ip, time(NULL)); } else { /* Reset our hit count list as necessary */ @@ -205,27 +205,27 @@ static int access_checker(request_rec *r struct stat s; FILE *file; - snprintf(filename, sizeof(filename), "%s/dos-%s", log_dir != NULL ? log_dir : DEFAULT_LOG_DIR, r->connection->remote_ip); + snprintf(filename, sizeof(filename), "%s/dos-%s", log_dir != NULL ? log_dir : DEFAULT_LOG_DIR, r->connection->client_ip); if (stat(filename, &s)) { file = fopen(filename, "w"); if (file != NULL) { fprintf(file, "%ld\n", getpid()); fclose(file); - 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 != NULL) { snprintf(filename, sizeof(filename), MAILER, email_notify); file = popen(filename, "w"); if (file != NULL) { fprintf(file, "To: %s\n", email_notify); - fprintf(file, "Subject: HTTP BLACKLIST %s\n\n", r->connection->remote_ip); - fprintf(file, "mod_evasive HTTP Blacklisted %s\n", r->connection->remote_ip); + fprintf(file, "Subject: HTTP BLACKLIST %s\n\n", r->connection->client_ip); + fprintf(file, "mod_evasive HTTP Blacklisted %s\n", r->connection->client_ip); pclose(file); } } if (system_command != NULL) { - snprintf(filename, sizeof(filename), system_command, r->connection->remote_ip); + snprintf(filename, sizeof(filename), system_command, r->connection->client_ip); system(filename); } -- You are receiving this mail because: You are the assignee for the bug.