/[smecontribs]/rpms/smeserver-geoip/contribs9/smeserver-geoip-1.2-check_badcountries.patch
ViewVC logotype

Annotation of /rpms/smeserver-geoip/contribs9/smeserver-geoip-1.2-check_badcountries.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sat Jan 5 19:53:29 2019 UTC (5 years, 10 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-geoip-1_2-6_el6_sme, smeserver-geoip-1_2-14_el6_sme, smeserver-geoip-1_2-5_el6_sme, smeserver-geoip-1_2-7_el6_sme, smeserver-geoip-1_2-11_el6_sme, smeserver-geoip-1_2-10_el6_sme, smeserver-geoip-1_2-13_el6_sme, smeserver-geoip-1_2-12_el6_sme, smeserver-geoip-1_2-8_el6_sme, smeserver-geoip-1_2-9_el6_sme, HEAD
* Sat Jan 05 2019 Jean-Philipe Pialasse <tests@pialasse.com> 1.2-5.sme
- fix wrong loglevel LOGINFO instead of LOGNOTICE needed [SME: 10679]
- try first db v2 and back on v1 if not available [SME: 10691]
- workaround FATAL PLUGIN ERROR when method name_by_addr not existing priori geo-ip 1.39 [SME: 10691]

1 jpp 1.1 diff -Nur smeserver-geoip-1.2.old/root/usr/share/qpsmtpd/plugins/check_badcountries smeserver-geoip-1.2/root/usr/share/qpsmtpd/plugins/check_badcountries
2     --- smeserver-geoip-1.2.old/root/usr/share/qpsmtpd/plugins/check_badcountries 2019-01-05 14:42:43.487000000 -0500
3     +++ smeserver-geoip-1.2/root/usr/share/qpsmtpd/plugins/check_badcountries 2019-01-05 14:47:37.767000000 -0500
4     @@ -96,6 +96,8 @@
5    
6     =head1 CHANGES
7    
8     +2019-01 - JP Pialasse - make it compatible with old v1 + improve log level
9     +
10     2018-06 - John Crisp - modify to work with SME server
11    
12     2014-06 - Matt Simerson - added GeoIP2 support
13     @@ -152,9 +154,8 @@
14    
15     sub load_geoip {
16     my ( $self ) = @_;
17     - # prevent v1 from functioning
18     - # $self->load_geoip1() and return 1;
19     $self->load_geoip2() and return 1;
20     + $self->load_geoip1() and return 1; #only search v1 if v2 not available
21     return 0;
22     }
23    
24     @@ -278,7 +279,7 @@
25     # Returns DECLINED if there are no countries found above
26     return DECLINED unless $country;
27    
28     - $self->log(LOGINFO, "Country $country RemoteIP $ip");
29     + $self->log(LOGNOTICE, "Country $country RemoteIP $ip");
30    
31     for (@badcountries) {
32     my ($pattern, $response) = split /\s+/, $_, 2;
33     @@ -476,6 +477,7 @@
34     return $self->set_asn_ipv6($ip);
35     }
36     return if ! $self->{GeoIPASNum};
37     + return if ! $self->{GeoIPASNum}->can('name_by_addr');# prior Geo-IP 1.39 should use org_by_addr
38    
39     my $asn = $self->{GeoIPASNum}->name_by_addr($ip) or return;
40     if ('AS' eq substr($asn, 0, 2)) {

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed