]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next-switch-to...
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 10 Jun 2020 16:01:14 +0000 (18:01 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Wed, 10 Jun 2020 16:01:14 +0000 (18:01 +0200)
38 files changed:
config/cfgroot/geoip-functions.pl
config/cron/crontab
config/firewall/rules.pl
config/rootfiles/common/GeoIP [deleted file]
config/rootfiles/common/Locale-Country
config/rootfiles/common/aarch64/initscripts
config/rootfiles/common/aarch64/stage2
config/rootfiles/common/armv5tel/initscripts
config/rootfiles/common/geoip-database [deleted file]
config/rootfiles/common/geoip-generator [deleted file]
config/rootfiles/common/i586/initscripts
config/rootfiles/common/libloc [new file with mode: 0644]
config/rootfiles/common/stage2
config/rootfiles/common/x86_64/initscripts
config/rootfiles/common/x86_64/stage2
config/rootfiles/common/xtables-addons
html/cgi-bin/connections.cgi
html/cgi-bin/ipinfo.cgi
html/cgi-bin/logs.cgi/firewalllog.dat
html/cgi-bin/logs.cgi/firewalllogcountry.dat
html/cgi-bin/logs.cgi/firewalllogip.dat
html/cgi-bin/logs.cgi/showrequestfromcountry.dat
html/cgi-bin/netexternal.cgi
html/cgi-bin/ovpnmain.cgi
html/cgi-bin/remote.cgi
lfs/Locale-Country
lfs/geoip-database [deleted file]
lfs/geoip-generator [deleted file]
lfs/libloc [moved from lfs/GeoIP with 77% similarity]
lfs/xtables-addons
make.sh
src/initscripts/networking/red.up/99-geoip-database [deleted file]
src/patches/geoip_1_25_change_database_path.patch [deleted file]
src/patches/libloc-0.9.1-location-downloader-do-not-change-content-of-open-database.patch [new file with mode: 0644]
src/patches/libloc-0.9.1-remove-python-path-overrides-for-debian.patch [new file with mode: 0644]
src/patches/xtables-addons-3.2-fix-database-generation.patch [deleted file]
src/scripts/update-location-database [new file with mode: 0644]
src/scripts/xt_geoip_update [deleted file]

index b2319daaaffe7168d04cfafeabb2113af92cd08a..885c841dbf4560d752e7ce57e1837ef83b950a43 100644 (file)
 
 package GeoIP;
 
-use Geo::IP::PurePerl;
+use Location;
 use Locale::Codes::Country;
 
-my $geoip_database_dir = "/var/lib/GeoIP";
-my $location_database = "GeoLite2-Country-Locations-en.csv";
-
-my $database;
+# Hash which contains country codes and their names which are special or not
+# part of ISO 3166-1.
+my %not_iso_3166_location = (
+       "a1" => "Anonymous Proxy",
+       "a2" => "Satellite Provider",
+       "a3" => "Worldwide Anycast Instance",
+       "an" => "Netherlands Antilles",
+       "ap" => "Asia/Pacific Region",
+       "eu" => "Europe",
+       "fx" => "France, Metropolitan"
+);
+
+# Directory where the libloc database and keyfile lives.
+our $location_dir = "/var/lib/location/";
+
+# Libloc database file.
+our $database = "$location_dir/database.db";
+
+# Libloc keyfile to verify the database.
+our $keyfile = "$location_dir/signing-key.pem";
+
+# Directory which contains the exported databases.
+our $xt_geoip_db_directory = "/usr/share/xt_geoip/";
+
+#
+## Tiny function to init the location database.
+#
+sub init () {
+       # Init and open the database.
+       my $db = &Location::init($database);
+
+       # Return the database handle.
+       return $db;
+}
 
-sub lookup($) {
-       my $address = shift;
+#
+## Function to verify the integrity of the location database.
+#
+sub verify ($) {
+       my ($db_handle) = @_;
 
-       # Load the database into memory if not already done
-       if (!$database) {
-               $database = Geo::IP::PurePerl->new(GEOIP_MEMORY_CACHE);
+       # Verify the integrity of the database.
+       if(&Location::verify($db_handle, $keyfile)) {
+               # Success, return "1".
+               return 1;
        }
 
+       # If we got here, return nothing.
+       return;
+}
+
+#
+## Function to the the country code of a given address.
+#
+sub lookup_country_code($$) {
+       my ($db_handle, $address) = @_;
+
+       # Lookup the given address.
+       my $country_code = &Location::lookup_country_code($db_handle, $address);
+
        # Return the name of the country
-       return $database->country_code_by_name($address);
+       return $country_code;
 }
 
 # Function to get the flag icon for a specified country code.
@@ -102,17 +149,15 @@ sub get_full_country_name($) {
        # Remove whitespaces.
        chomp($input);
 
+
        # Convert input into lower case format.
        my $code = lc($input);
 
        # Handle country codes which are not in the list.
-       if ($code eq "a1") { $name = "Anonymous Proxy" }
-       elsif ($code eq "a2") { $name = "Satellite Provider" }
-       elsif ($code eq "o1") { $name = "Other Country" }
-       elsif ($code eq "ap") { $name = "Asia/Pacific Region" }
-       elsif ($code eq "eu") { $name = "Europe" }
-       elsif ($code eq "yu") { $name = "Yugoslavia" }
-       else {
+       if ($not_iso_3166_location{$code}) {
+               # Grab location name from hash.
+               $name = $not_iso_3166_location{$code};
+       } else {
                # Use perl built-in module to get the country code.
                $name = &Locale::Codes::Country::code2country($code);
        }
@@ -124,26 +169,27 @@ sub get_full_country_name($) {
 sub get_geoip_locations() {
        my @locations = ();
 
-       # Open the location database.
-       open(LOCATION, "$geoip_database_dir/$location_database") or return @locations;
+       # Get listed country codes from ISO 3166-1.
+       my @locations_lc = &Locale::Codes::Country::all_country_codes();
 
-       # Loop through the file.
-       while(my $line = <LOCATION>) {
-               # Remove newlines.
-               chomp($line);
+       # The Codes::Country module provides the country codes only in lower case.
+       # So we have to loop over the array and convert them into upper case format.
+       foreach my $ccode (@locations_lc) {
+               # Convert the country code to uppercase.
+               my $ccode_uc = uc($ccode);
 
-               # Split the line content.
-               my ($geoname_id, $locale_code, $continent_code, $continent_name, $country_iso_code, $country_name, $is_in_european_union) = split(/\,/, $line);
-
-               # Check if the country_iso_code is upper case.
-               if($country_iso_code =~ /[A-Z]/) {
-                       # Add the current ISO code.
-                       push(@locations, $country_iso_code);
-               }
+               # Add the converted ccode to the locations array.
+               push(@locations, $ccode_uc);
        }
 
-       # Close filehandle.
-       close(LOCATION);
+       # Add locations from not_iso_3166_locations.
+       foreach my $location (keys %not_iso_3166_location) {
+               # Convert the location into uppercase.
+               my $location_uc = uc($location);
+
+               # Add the location to the locations array.
+               push(@locations, $location_uc);
+       }
 
        # Sort locations array in alphabetical order.
        my @sorted_locations = sort(@locations);
@@ -152,5 +198,63 @@ sub get_geoip_locations() {
        return @sorted_locations;
 }
 
+# Function to get the continent code of a given country code.
+sub get_continent_code($$) {
+       my ($db_handle, $ccode) = @_;
+
+       # Omit the continent code.
+       my $continent_code = &Location::get_continent_code($db_handle, $ccode);
+
+       return $continent_code;
+}
+
+# Function to flush all exported GeoIP locations.
+sub flush_exported_locations () {
+       # Check if the xt_geoip_db_directory exists.
+       if (-e $xt_geoip_db_directory) {
+               # Perform a direcory listing.
+               opendir (DIR, $xt_geoip_db_directory) or die "Could not open $xt_geoip_db_directory. $!\n";
+
+               # Loop through the files.
+               while (my $file = readdir(DIR)) {
+                       # Check if the element is a file.
+                       if (-f "$xt_geoip_db_directory/$file") {
+                               # Delete it.
+                               unlink("$xt_geoip_db_directory/$file");
+                       }
+               }
+       }
+}
+
+# Function which calls location-exporter to export a given array
+# of locations.
+sub export_locations (\@) {
+       my @locations = @{ shift() };
+
+       # String to store the given locations and pass it to the exporter tool.
+       my $locations_string;
+
+       # Only export IPv4 addresses.
+       my $family = "--family=ipv4";
+
+       # Specify xt_geoip as output format.
+       my $format = "--format=xt_geoip";
+
+       # Location export command.
+       my @command = ("/usr/bin/location-exporter", "--directory=$xt_geoip_db_directory", "$format", "$family");
+
+       # Check if the export directory exists, otherwise create it.
+       unless (-d $xt_geoip_db_directory) { mkdir $xt_geoip_db_directory };
+
+       # Loop through the array of locations which needs to be exported.
+       foreach my $location (@locations) {
+               # Add location to the command array.
+               push(@command, $location);
+       }
+
+       # Execute location-exporter to export the requested country codes.
+       system(@command) == 0
+               or die "@command failed: $?";
+}
 
 1;
index 56801394ece18abd19b2df5c324db30befa64c20..519554195bd0543e58773c086599f08f7801d461 100644 (file)
@@ -60,7 +60,7 @@ HOME=/
 00 2 * 10-11 0      /usr/local/bin/timezone-transition /usr/local/bin/firewallctrl
 
 # Update GeoIP database once a month.
-%monthly,random * * * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/xt_geoip_update >/dev/null 2>&1
+%hourly,random * * * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-location-database >/dev/null 2>&1
 
 # Retry sending spooled mails regularly
 %hourly * /usr/sbin/dma -q
index 387a8f92ba232dccf6308ae56badc5717a086ff5..40a2632005ceb09f238cd6b7e614463b2634ca74 100644 (file)
@@ -24,6 +24,7 @@ use experimental 'smartmatch';
 
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
+require "${General::swroot}/geoip-functions.pl";
 require "/usr/lib/firewall/firewall-lib.pl";
 
 # Set to one to enable debugging mode.
@@ -55,6 +56,10 @@ my %customgrp=();
 my %configinputfw=();
 my %configoutgoingfw=();
 my %confignatfw=();
+my %geoipsettings = (
+       "GEOIPBLOCK_ENABLED" => "off"
+);
+
 my @p2ps=();
 
 my $configfwdfw                = "${General::swroot}/firewall/config";
@@ -73,6 +78,15 @@ my $netsettings              = "${General::swroot}/ethernet/settings";
 &General::readhasharray($configoutgoing, \%configoutgoingfw);
 &General::readhasharray($configgrp, \%customgrp);
 
+# Check if the geoip settings file exists
+if (-e "$geoipfile") {
+       # Read settings file
+       &General::readhash("$geoipfile", \%geoipsettings);
+}
+
+# Get all GeoIP locations.
+my @locations = &fwlib::get_geoip_locations();
+
 my @log_limit_options = &make_log_limit_options();
 
 my $POLICY_INPUT_ALLOWED   = 0;
@@ -87,9 +101,21 @@ my $POLICY_OUTPUT_ACTION   = $fwoptions{"FWPOLICY1"};
 &main();
 
 sub main {
+       # Gather locations which should be exported.
+       my @locations_to_export = &gather_locations_to_export();
+
        # Flush all chains.
        &flush();
 
+       # Flush exported locations.
+       &GeoIP::flush_exported_locations();
+
+       # Check if there are any locations to export.
+       if (@locations_to_export) {
+               # Export required locations.
+               &GeoIP::export_locations(\@locations_to_export);
+       }
+
        # Prepare firewall rules.
        if (! -z  "${General::swroot}/firewall/input"){
                &buildrules(\%configinputfw);
@@ -598,27 +624,15 @@ sub p2pblock {
 }
 
 sub geoipblock {
-       my %geoipsettings = ();
-       $geoipsettings{'GEOIPBLOCK_ENABLED'} = "off";
-
        # Flush iptables chain.
        run("$IPTABLES -F GEOIPBLOCK");
 
-       # Check if the geoip settings file exists
-       if (-e "$geoipfile") {
-               # Read settings file
-               &General::readhash("$geoipfile", \%geoipsettings);
-       }
-
        # If geoip blocking is not enabled, we are finished here.
        if ($geoipsettings{'GEOIPBLOCK_ENABLED'} ne "on") {
                # Exit submodule. Process remaining script.
                return;
        }
 
-       # Get supported locations.
-       my @locations = &fwlib::get_geoip_locations();
-
        # Loop through all supported geoip locations and
        # create iptables rules, if blocking this country
        # is enabled.
@@ -841,3 +855,142 @@ sub firewall_is_in_subnet {
 
        return 0;
 }
+
+#
+# Function to gather which locations needs to be exported.
+#
+sub gather_locations_to_export () {
+       my %geoipblock_exports = ();
+
+       # Array to store the final list of locations.
+       my @export_locations;
+
+       # Array to temporary store all used GeoIP groups.
+       my @used_GeoIP_groups;
+
+       # Check if GeoIP-block is enabled.
+       if($geoipsettings{"GEOIPBLOCK_ENABLED"} eq "on") {
+               # Loop through the array of supported locations.
+               foreach my $location (@locations) {
+                       if ($geoipsettings{$location} eq "on") {
+                               $geoipblock_exports{$location} = "1";
+                       }
+               }
+       }
+
+       # Get the firewall locations of the input, forward and output
+       # firewall settings hashhes.
+       my %input_exports = &_grab_geoip_locations_from_fw_settings_hash(\%configinputfw);
+       my %forward_exports = &_grab_geoip_locations_from_fw_settings_hash(\%configfwdfw);
+       my %output_exports = &_grab_geoip_locations_from_fw_settings_hash(\%configoutgoingfw);
+
+       # Merge the hashes.
+       #
+       # If a location is part of multiple hashes, it results in only one entry in the final hash.
+       my %export_locations = ( %geoipblock_exports, %input_exports, %forward_exports, %output_exports );
+
+       # Loop through the hash of exported locations.
+       foreach my $location (keys %export_locations) {
+               # Convert location into upper-case format.
+               my $location_uc = uc($location);
+
+               # Add the location to the array.
+               push(@export_locations, $location_uc);
+       }
+
+       # Return the array.
+       return @export_locations;
+}
+
+#
+# Function to gather the GeoIP locations from a given hash
+# containing the firewall settings.
+#
+sub _grab_geoip_locations_from_fw_settings_hash (\%) {
+       my $hash = shift;
+       my %exports;
+
+       # Loop through the given firewall config hash.
+       foreach my $rule ( keys %$hash ) {
+               # Skip if the rule is disabled.
+               next unless($$hash{$rule}[2] eq "ON");
+
+               # Process rules with GeoIP as source.
+               if($$hash{$rule}[3] eq "cust_geoip_src") {
+                       my $source = $$hash{$rule}[4];
+
+                       # Check if the source is a group.
+                       if($source =~ m/group/) {
+                              my($group, $groupname) = split(":", $source);
+
+                               # Get locations which are part of the group.
+                               my @group_locations = &_grab_geoip_locations_from_group($groupname);
+
+                               # Loop through the array.
+                               foreach my $location (@group_locations) {
+                                       # Add location to the exports hash.
+                                       $exports{$location} = "1";
+                               }
+                       } else {
+                               # Add location to the exports hash.
+                               $exports{$source} = "1";
+                       }
+
+                       # Jump the next rule.
+                       next;
+               }
+
+               # Process rules with GeoIP as target.
+               if($$hash{$rule}[5] eq "cust_geoip_tgt") {
+                       my $destination = $$hash{$rule}[6];
+
+                       # Check if the destination is a group.
+                       if($destination =~ m/group/) {
+                               my($group, $groupname) = split(":", $destination);
+
+                               # Get locations which are part of the group.
+                               my @group_locations = &_grab_geoip_locations_from_group($groupname);
+
+                               # Loop through the array.
+                               foreach my $location (@group_locations) {
+                                       # Add location to the exports hash.
+                                       $exports{$location} = "1";
+                               }
+                       } else {
+                               # Add location to the exports hash.
+                               $exports{$destination} = "1";
+                       }
+
+                       # Jump to next rule.
+                       next;
+               }
+       }
+
+       # Return the array.
+       return %exports;
+}
+
+#
+# Function to gather the GeoIP locations from a given group name.
+#
+sub _grab_geoip_locations_from_group($) {
+       my ($groupname) = @_;
+
+       my %geoipgroups = ();
+       my @group_locations;
+
+       # Get all configured GeoIP related groups.
+       &General::readhasharray("${General::swroot}/fwhosts/customgeoipgrp", \%geoipgroups);
+
+       # Loop through the hash of GeoIP groups.
+       foreach my $key (keys %geoipgroups) {
+               # Seach for members of the given group.
+               if($geoipgroups{$key}[0] eq "$groupname") {
+                       # Add the location to the group_locations array.
+                       push(@group_locations, $geoipgroups{$key}[2]);
+               }
+       }
+
+       # Return the array.
+       return @group_locations;
+}
diff --git a/config/rootfiles/common/GeoIP b/config/rootfiles/common/GeoIP
deleted file mode 100644 (file)
index a7cd2e3..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#usr/bin/geoip-lookup
-#usr/lib/perl5/site_perl/5.30.0/Geo
-#usr/lib/perl5/site_perl/5.30.0/Geo/IP
-usr/lib/perl5/site_perl/5.30.0/Geo/IP/PurePerl.pm
-#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Geo
-#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Geo/IP
-#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Geo/IP/PurePerl
-#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Geo/IP/PurePerl/.packlist
-#usr/share/GeoIP
-usr/share/GeoIP/GeoIP.dat
-#usr/share/man/man1/geoip-lookup.1
-#usr/share/man/man3/Geo::IP::PurePerl.3
index 07d8144c7de8cb38d81393698f838a496c8503e1..941c18121d84b2163e445e5a9f103cc10ed1865a 100644 (file)
@@ -1,61 +1,59 @@
-#usr/lib/perl5/5.30.0/Locale/Codes
-usr/lib/perl5/5.30.0/Locale/Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes.pod
-usr/lib/perl5/5.30.0/Locale/Codes/API.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Changes.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Constants.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Constants.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Country.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Country.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Country_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Country_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Currency.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Currency.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Currency_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Currency_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangExt.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangExt.pod
-usr/lib/perl5/5.30.0/Locale/Codes/LangExt_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangExt_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangFam.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangFam.pod
-usr/lib/perl5/5.30.0/Locale/Codes/LangFam_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangFam_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangVar.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangVar.pod
-usr/lib/perl5/5.30.0/Locale/Codes/LangVar_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/LangVar_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Language.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Language.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Language_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Language_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Script.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Script.pod
-usr/lib/perl5/5.30.0/Locale/Codes/Script_Codes.pm
-usr/lib/perl5/5.30.0/Locale/Codes/Script_Retired.pm
-usr/lib/perl5/5.30.0/Locale/Country.pm
-#usr/lib/perl5/5.30.0/Locale/Country.pod
-usr/lib/perl5/5.30.0/Locale/Currency.pm
-#usr/lib/perl5/5.30.0/Locale/Currency.pod
-usr/lib/perl5/5.30.0/Locale/Language.pm
-#usr/lib/perl5/5.30.0/Locale/Language.pod
-usr/lib/perl5/5.30.0/Locale/Script.pm
-#usr/lib/perl5/5.30.0/Locale/Script.pod
-#usr/lib/perl5/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale
-#usr/lib/perl5/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale/Codes
-#usr/lib/perl5/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale/Codes/.packlist
+#usr/lib/perl5/site_perl/5.30.0/Locale
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes.pod
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Changes.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Constants.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Country.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Country.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Country_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Country_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Currency.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Currency.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Currency_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Currency_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangExt.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangExt.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangExt_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangExt_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangFam.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangFam.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangFam_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangFam_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangVar.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangVar.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangVar_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/LangVar_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Language.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Language.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Language_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Language_Retired.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Script.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Script.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Script_Codes.pm
+usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Script_Retired.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Codes/Types.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Country.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Country.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Currency.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Currency.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Language.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Language.pod
+usr/lib/perl5/site_perl/5.30.0/Locale/Script.pm
+#usr/lib/perl5/site_perl/5.30.0/Locale/Script.pod
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale/Codes
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Locale/Codes/.packlist
 #usr/share/man/man3/Locale::Codes.3
-#usr/share/man/man3/Locale::Codes::API.3
 #usr/share/man/man3/Locale::Codes::Changes.3
-#usr/share/man/man3/Locale::Codes::Constants.3
 #usr/share/man/man3/Locale::Codes::Country.3
 #usr/share/man/man3/Locale::Codes::Currency.3
 #usr/share/man/man3/Locale::Codes::LangExt.3
 #usr/share/man/man3/Locale::Codes::LangFam.3
-#usr/share/man/man3/Locale::Codes::LangFam_Retired.3
 #usr/share/man/man3/Locale::Codes::LangVar.3
 #usr/share/man/man3/Locale::Codes::Language.3
 #usr/share/man/man3/Locale::Codes::Script.3
+#usr/share/man/man3/Locale::Codes::Types.3
 #usr/share/man/man3/Locale::Country.3
 #usr/share/man/man3/Locale::Currency.3
 #usr/share/man/man3/Locale::Language.3
index 8d945f7a5a43a4b4286a694289d088b1e7b8f383..7c81fe765bb66e599ff001380d9e1da7ed7c051e 100644 (file)
@@ -65,7 +65,6 @@ etc/rc.d/init.d/networking/red.up/50-ovpn
 etc/rc.d/init.d/networking/red.up/98-leds
 etc/rc.d/init.d/networking/red.up/99-beep
 etc/rc.d/init.d/networking/red.up/99-fireinfo
-etc/rc.d/init.d/networking/red.up/99-geoip-database
 etc/rc.d/init.d/networking/red.up/99-pakfire-update
 etc/rc.d/init.d/networking/wpa_supplicant.exe
 etc/rc.d/init.d/ntp
index 77c8e97b9a44ac139a1811f1bfe053322abcf071..3359632a37d7f3b9cb7b364b79a026b2a5aed036 100644 (file)
@@ -107,8 +107,7 @@ usr/local/bin/settime
 usr/local/bin/timecheck
 usr/local/bin/timezone-transition
 usr/local/bin/update-ids-ruleset
-usr/local/bin/update-lang-cache
-usr/local/bin/xt_geoip_update
+usr/local/bin/update-location-database
 #usr/local/include
 #usr/local/lib
 #usr/local/lib/sse2
index 8d945f7a5a43a4b4286a694289d088b1e7b8f383..7c81fe765bb66e599ff001380d9e1da7ed7c051e 100644 (file)
@@ -65,7 +65,6 @@ etc/rc.d/init.d/networking/red.up/50-ovpn
 etc/rc.d/init.d/networking/red.up/98-leds
 etc/rc.d/init.d/networking/red.up/99-beep
 etc/rc.d/init.d/networking/red.up/99-fireinfo
-etc/rc.d/init.d/networking/red.up/99-geoip-database
 etc/rc.d/init.d/networking/red.up/99-pakfire-update
 etc/rc.d/init.d/networking/wpa_supplicant.exe
 etc/rc.d/init.d/ntp
diff --git a/config/rootfiles/common/geoip-database b/config/rootfiles/common/geoip-database
deleted file mode 100644 (file)
index 6e4bbdb..0000000
+++ /dev/null
@@ -1,523 +0,0 @@
-usr/share/GeoIP/GeoIP.dat
-usr/share/xt_geoip/A1.iv4
-usr/share/xt_geoip/A1.iv6
-usr/share/xt_geoip/A2.iv4
-usr/share/xt_geoip/A2.iv6
-usr/share/xt_geoip/AD.iv4
-usr/share/xt_geoip/AD.iv6
-usr/share/xt_geoip/AE.iv4
-usr/share/xt_geoip/AE.iv6
-usr/share/xt_geoip/AF.iv4
-usr/share/xt_geoip/AF.iv6
-usr/share/xt_geoip/AG.iv4
-usr/share/xt_geoip/AG.iv6
-usr/share/xt_geoip/AI.iv4
-usr/share/xt_geoip/AI.iv6
-usr/share/xt_geoip/AL.iv4
-usr/share/xt_geoip/AL.iv6
-usr/share/xt_geoip/AM.iv4
-usr/share/xt_geoip/AM.iv6
-usr/share/xt_geoip/AO.iv4
-usr/share/xt_geoip/AO.iv6
-usr/share/xt_geoip/AQ.iv4
-usr/share/xt_geoip/AQ.iv6
-usr/share/xt_geoip/AR.iv4
-usr/share/xt_geoip/AR.iv6
-usr/share/xt_geoip/AS.iv4
-usr/share/xt_geoip/AS.iv6
-usr/share/xt_geoip/AT.iv4
-usr/share/xt_geoip/AT.iv6
-usr/share/xt_geoip/AU.iv4
-usr/share/xt_geoip/AU.iv6
-usr/share/xt_geoip/AW.iv4
-usr/share/xt_geoip/AW.iv6
-usr/share/xt_geoip/AX.iv4
-usr/share/xt_geoip/AX.iv6
-usr/share/xt_geoip/AZ.iv4
-usr/share/xt_geoip/AZ.iv6
-usr/share/xt_geoip/BA.iv4
-usr/share/xt_geoip/BA.iv6
-usr/share/xt_geoip/BB.iv4
-usr/share/xt_geoip/BB.iv6
-usr/share/xt_geoip/BD.iv4
-usr/share/xt_geoip/BD.iv6
-usr/share/xt_geoip/BE.iv4
-usr/share/xt_geoip/BE.iv6
-usr/share/xt_geoip/BF.iv4
-usr/share/xt_geoip/BF.iv6
-usr/share/xt_geoip/BG.iv4
-usr/share/xt_geoip/BG.iv6
-usr/share/xt_geoip/BH.iv4
-usr/share/xt_geoip/BH.iv6
-usr/share/xt_geoip/BI.iv4
-usr/share/xt_geoip/BI.iv6
-usr/share/xt_geoip/BJ.iv4
-usr/share/xt_geoip/BJ.iv6
-usr/share/xt_geoip/BL.iv4
-usr/share/xt_geoip/BL.iv6
-usr/share/xt_geoip/BM.iv4
-usr/share/xt_geoip/BM.iv6
-usr/share/xt_geoip/BN.iv4
-usr/share/xt_geoip/BN.iv6
-usr/share/xt_geoip/BO.iv4
-usr/share/xt_geoip/BO.iv6
-usr/share/xt_geoip/BQ.iv4
-usr/share/xt_geoip/BQ.iv6
-usr/share/xt_geoip/BR.iv4
-usr/share/xt_geoip/BR.iv6
-usr/share/xt_geoip/BS.iv4
-usr/share/xt_geoip/BS.iv6
-usr/share/xt_geoip/BT.iv4
-usr/share/xt_geoip/BT.iv6
-usr/share/xt_geoip/BV.iv4
-usr/share/xt_geoip/BV.iv6
-usr/share/xt_geoip/BW.iv4
-usr/share/xt_geoip/BW.iv6
-usr/share/xt_geoip/BY.iv4
-usr/share/xt_geoip/BY.iv6
-usr/share/xt_geoip/BZ.iv4
-usr/share/xt_geoip/BZ.iv6
-usr/share/xt_geoip/CA.iv4
-usr/share/xt_geoip/CA.iv6
-usr/share/xt_geoip/CC.iv4
-usr/share/xt_geoip/CC.iv6
-usr/share/xt_geoip/CD.iv4
-usr/share/xt_geoip/CD.iv6
-usr/share/xt_geoip/CF.iv4
-usr/share/xt_geoip/CF.iv6
-usr/share/xt_geoip/CG.iv4
-usr/share/xt_geoip/CG.iv6
-usr/share/xt_geoip/CH.iv4
-usr/share/xt_geoip/CH.iv6
-usr/share/xt_geoip/CI.iv4
-usr/share/xt_geoip/CI.iv6
-usr/share/xt_geoip/CK.iv4
-usr/share/xt_geoip/CK.iv6
-usr/share/xt_geoip/CL.iv4
-usr/share/xt_geoip/CL.iv6
-usr/share/xt_geoip/CM.iv4
-usr/share/xt_geoip/CM.iv6
-usr/share/xt_geoip/CN.iv4
-usr/share/xt_geoip/CN.iv6
-usr/share/xt_geoip/CO.iv4
-usr/share/xt_geoip/CO.iv6
-usr/share/xt_geoip/CR.iv4
-usr/share/xt_geoip/CR.iv6
-usr/share/xt_geoip/CU.iv4
-usr/share/xt_geoip/CU.iv6
-usr/share/xt_geoip/CV.iv4
-usr/share/xt_geoip/CV.iv6
-usr/share/xt_geoip/CW.iv4
-usr/share/xt_geoip/CW.iv6
-usr/share/xt_geoip/CX.iv4
-usr/share/xt_geoip/CX.iv6
-usr/share/xt_geoip/CY.iv4
-usr/share/xt_geoip/CY.iv6
-usr/share/xt_geoip/CZ.iv4
-usr/share/xt_geoip/CZ.iv6
-usr/share/xt_geoip/DE.iv4
-usr/share/xt_geoip/DE.iv6
-usr/share/xt_geoip/DJ.iv4
-usr/share/xt_geoip/DJ.iv6
-usr/share/xt_geoip/DK.iv4
-usr/share/xt_geoip/DK.iv6
-usr/share/xt_geoip/DM.iv4
-usr/share/xt_geoip/DM.iv6
-usr/share/xt_geoip/DO.iv4
-usr/share/xt_geoip/DO.iv6
-usr/share/xt_geoip/DZ.iv4
-usr/share/xt_geoip/DZ.iv6
-usr/share/xt_geoip/EC.iv4
-usr/share/xt_geoip/EC.iv6
-usr/share/xt_geoip/EE.iv4
-usr/share/xt_geoip/EE.iv6
-usr/share/xt_geoip/EG.iv4
-usr/share/xt_geoip/EG.iv6
-usr/share/xt_geoip/EH.iv4
-usr/share/xt_geoip/EH.iv6
-usr/share/xt_geoip/ER.iv4
-usr/share/xt_geoip/ER.iv6
-usr/share/xt_geoip/ES.iv4
-usr/share/xt_geoip/ES.iv6
-usr/share/xt_geoip/ET.iv4
-usr/share/xt_geoip/ET.iv6
-usr/share/xt_geoip/EU.iv4
-usr/share/xt_geoip/EU.iv6
-usr/share/xt_geoip/FI.iv4
-usr/share/xt_geoip/FI.iv6
-usr/share/xt_geoip/FJ.iv4
-usr/share/xt_geoip/FJ.iv6
-usr/share/xt_geoip/FK.iv4
-usr/share/xt_geoip/FK.iv6
-usr/share/xt_geoip/FM.iv4
-usr/share/xt_geoip/FM.iv6
-usr/share/xt_geoip/FO.iv4
-usr/share/xt_geoip/FO.iv6
-usr/share/xt_geoip/FR.iv4
-usr/share/xt_geoip/FR.iv6
-usr/share/xt_geoip/GA.iv4
-usr/share/xt_geoip/GA.iv6
-usr/share/xt_geoip/GB.iv4
-usr/share/xt_geoip/GB.iv6
-usr/share/xt_geoip/GD.iv4
-usr/share/xt_geoip/GD.iv6
-usr/share/xt_geoip/GE.iv4
-usr/share/xt_geoip/GE.iv6
-usr/share/xt_geoip/GF.iv4
-usr/share/xt_geoip/GF.iv6
-usr/share/xt_geoip/GG.iv4
-usr/share/xt_geoip/GG.iv6
-usr/share/xt_geoip/GH.iv4
-usr/share/xt_geoip/GH.iv6
-usr/share/xt_geoip/GI.iv4
-usr/share/xt_geoip/GI.iv6
-usr/share/xt_geoip/GL.iv4
-usr/share/xt_geoip/GL.iv6
-usr/share/xt_geoip/GM.iv4
-usr/share/xt_geoip/GM.iv6
-usr/share/xt_geoip/GN.iv4
-usr/share/xt_geoip/GN.iv6
-usr/share/xt_geoip/GP.iv4
-usr/share/xt_geoip/GP.iv6
-usr/share/xt_geoip/GQ.iv4
-usr/share/xt_geoip/GQ.iv6
-usr/share/xt_geoip/GR.iv4
-usr/share/xt_geoip/GR.iv6
-usr/share/xt_geoip/GS.iv4
-usr/share/xt_geoip/GS.iv6
-usr/share/xt_geoip/GT.iv4
-usr/share/xt_geoip/GT.iv6
-usr/share/xt_geoip/GU.iv4
-usr/share/xt_geoip/GU.iv6
-usr/share/xt_geoip/GW.iv4
-usr/share/xt_geoip/GW.iv6
-usr/share/xt_geoip/GY.iv4
-usr/share/xt_geoip/GY.iv6
-usr/share/xt_geoip/HK.iv4
-usr/share/xt_geoip/HK.iv6
-usr/share/xt_geoip/HM.iv4
-usr/share/xt_geoip/HM.iv6
-usr/share/xt_geoip/HN.iv4
-usr/share/xt_geoip/HN.iv6
-usr/share/xt_geoip/HR.iv4
-usr/share/xt_geoip/HR.iv6
-usr/share/xt_geoip/HT.iv4
-usr/share/xt_geoip/HT.iv6
-usr/share/xt_geoip/HU.iv4
-usr/share/xt_geoip/HU.iv6
-usr/share/xt_geoip/ID.iv4
-usr/share/xt_geoip/ID.iv6
-usr/share/xt_geoip/IE.iv4
-usr/share/xt_geoip/IE.iv6
-usr/share/xt_geoip/IL.iv4
-usr/share/xt_geoip/IL.iv6
-usr/share/xt_geoip/IM.iv4
-usr/share/xt_geoip/IM.iv6
-usr/share/xt_geoip/IN.iv4
-usr/share/xt_geoip/IN.iv6
-usr/share/xt_geoip/IO.iv4
-usr/share/xt_geoip/IO.iv6
-usr/share/xt_geoip/IQ.iv4
-usr/share/xt_geoip/IQ.iv6
-usr/share/xt_geoip/IR.iv4
-usr/share/xt_geoip/IR.iv6
-usr/share/xt_geoip/IS.iv4
-usr/share/xt_geoip/IS.iv6
-usr/share/xt_geoip/IT.iv4
-usr/share/xt_geoip/IT.iv6
-usr/share/xt_geoip/JE.iv4
-usr/share/xt_geoip/JE.iv6
-usr/share/xt_geoip/JM.iv4
-usr/share/xt_geoip/JM.iv6
-usr/share/xt_geoip/JO.iv4
-usr/share/xt_geoip/JO.iv6
-usr/share/xt_geoip/JP.iv4
-usr/share/xt_geoip/JP.iv6
-usr/share/xt_geoip/KE.iv4
-usr/share/xt_geoip/KE.iv6
-usr/share/xt_geoip/KG.iv4
-usr/share/xt_geoip/KG.iv6
-usr/share/xt_geoip/KH.iv4
-usr/share/xt_geoip/KH.iv6
-usr/share/xt_geoip/KI.iv4
-usr/share/xt_geoip/KI.iv6
-usr/share/xt_geoip/KM.iv4
-usr/share/xt_geoip/KM.iv6
-usr/share/xt_geoip/KN.iv4
-usr/share/xt_geoip/KN.iv6
-usr/share/xt_geoip/KP.iv4
-usr/share/xt_geoip/KP.iv6
-usr/share/xt_geoip/KR.iv4
-usr/share/xt_geoip/KR.iv6
-usr/share/xt_geoip/KW.iv4
-usr/share/xt_geoip/KW.iv6
-usr/share/xt_geoip/KY.iv4
-usr/share/xt_geoip/KY.iv6
-usr/share/xt_geoip/KZ.iv4
-usr/share/xt_geoip/KZ.iv6
-usr/share/xt_geoip/LA.iv4
-usr/share/xt_geoip/LA.iv6
-usr/share/xt_geoip/LB.iv4
-usr/share/xt_geoip/LB.iv6
-usr/share/xt_geoip/LC.iv4
-usr/share/xt_geoip/LC.iv6
-usr/share/xt_geoip/LI.iv4
-usr/share/xt_geoip/LI.iv6
-usr/share/xt_geoip/LK.iv4
-usr/share/xt_geoip/LK.iv6
-usr/share/xt_geoip/LR.iv4
-usr/share/xt_geoip/LR.iv6
-usr/share/xt_geoip/LS.iv4
-usr/share/xt_geoip/LS.iv6
-usr/share/xt_geoip/LT.iv4
-usr/share/xt_geoip/LT.iv6
-usr/share/xt_geoip/LU.iv4
-usr/share/xt_geoip/LU.iv6
-usr/share/xt_geoip/LV.iv4
-usr/share/xt_geoip/LV.iv6
-usr/share/xt_geoip/LY.iv4
-usr/share/xt_geoip/LY.iv6
-usr/share/xt_geoip/MA.iv4
-usr/share/xt_geoip/MA.iv6
-usr/share/xt_geoip/MC.iv4
-usr/share/xt_geoip/MC.iv6
-usr/share/xt_geoip/MD.iv4
-usr/share/xt_geoip/MD.iv6
-usr/share/xt_geoip/ME.iv4
-usr/share/xt_geoip/ME.iv6
-usr/share/xt_geoip/MF.iv4
-usr/share/xt_geoip/MF.iv6
-usr/share/xt_geoip/MG.iv4
-usr/share/xt_geoip/MG.iv6
-usr/share/xt_geoip/MH.iv4
-usr/share/xt_geoip/MH.iv6
-usr/share/xt_geoip/MK.iv4
-usr/share/xt_geoip/MK.iv6
-usr/share/xt_geoip/ML.iv4
-usr/share/xt_geoip/ML.iv6
-usr/share/xt_geoip/MM.iv4
-usr/share/xt_geoip/MM.iv6
-usr/share/xt_geoip/MN.iv4
-usr/share/xt_geoip/MN.iv6
-usr/share/xt_geoip/MO.iv4
-usr/share/xt_geoip/MO.iv6
-usr/share/xt_geoip/MP.iv4
-usr/share/xt_geoip/MP.iv6
-usr/share/xt_geoip/MQ.iv4
-usr/share/xt_geoip/MQ.iv6
-usr/share/xt_geoip/MR.iv4
-usr/share/xt_geoip/MR.iv6
-usr/share/xt_geoip/MS.iv4
-usr/share/xt_geoip/MS.iv6
-usr/share/xt_geoip/MT.iv4
-usr/share/xt_geoip/MT.iv6
-usr/share/xt_geoip/MU.iv4
-usr/share/xt_geoip/MU.iv6
-usr/share/xt_geoip/MV.iv4
-usr/share/xt_geoip/MV.iv6
-usr/share/xt_geoip/MW.iv4
-usr/share/xt_geoip/MW.iv6
-usr/share/xt_geoip/MX.iv4
-usr/share/xt_geoip/MX.iv6
-usr/share/xt_geoip/MY.iv4
-usr/share/xt_geoip/MY.iv6
-usr/share/xt_geoip/MZ.iv4
-usr/share/xt_geoip/MZ.iv6
-usr/share/xt_geoip/NA.iv4
-usr/share/xt_geoip/NA.iv6
-usr/share/xt_geoip/NC.iv4
-usr/share/xt_geoip/NC.iv6
-usr/share/xt_geoip/NE.iv4
-usr/share/xt_geoip/NE.iv6
-usr/share/xt_geoip/NF.iv4
-usr/share/xt_geoip/NF.iv6
-usr/share/xt_geoip/NG.iv4
-usr/share/xt_geoip/NG.iv6
-usr/share/xt_geoip/NI.iv4
-usr/share/xt_geoip/NI.iv6
-usr/share/xt_geoip/NL.iv4
-usr/share/xt_geoip/NL.iv6
-usr/share/xt_geoip/NO.iv4
-usr/share/xt_geoip/NO.iv6
-usr/share/xt_geoip/NP.iv4
-usr/share/xt_geoip/NP.iv6
-usr/share/xt_geoip/NR.iv4
-usr/share/xt_geoip/NR.iv6
-usr/share/xt_geoip/NU.iv4
-usr/share/xt_geoip/NU.iv6
-usr/share/xt_geoip/NZ.iv4
-usr/share/xt_geoip/NZ.iv6
-usr/share/xt_geoip/O1.iv4
-usr/share/xt_geoip/O1.iv6
-usr/share/xt_geoip/OM.iv4
-usr/share/xt_geoip/OM.iv6
-usr/share/xt_geoip/PA.iv4
-usr/share/xt_geoip/PA.iv6
-usr/share/xt_geoip/PE.iv4
-usr/share/xt_geoip/PE.iv6
-usr/share/xt_geoip/PF.iv4
-usr/share/xt_geoip/PF.iv6
-usr/share/xt_geoip/PG.iv4
-usr/share/xt_geoip/PG.iv6
-usr/share/xt_geoip/PH.iv4
-usr/share/xt_geoip/PH.iv6
-usr/share/xt_geoip/PK.iv4
-usr/share/xt_geoip/PK.iv6
-usr/share/xt_geoip/PL.iv4
-usr/share/xt_geoip/PL.iv6
-usr/share/xt_geoip/PM.iv4
-usr/share/xt_geoip/PM.iv6
-usr/share/xt_geoip/PN.iv4
-usr/share/xt_geoip/PN.iv6
-usr/share/xt_geoip/PR.iv4
-usr/share/xt_geoip/PR.iv6
-usr/share/xt_geoip/PS.iv4
-usr/share/xt_geoip/PS.iv6
-usr/share/xt_geoip/PT.iv4
-usr/share/xt_geoip/PT.iv6
-usr/share/xt_geoip/PW.iv4
-usr/share/xt_geoip/PW.iv6
-usr/share/xt_geoip/PY.iv4
-usr/share/xt_geoip/PY.iv6
-usr/share/xt_geoip/QA.iv4
-usr/share/xt_geoip/QA.iv6
-usr/share/xt_geoip/RE.iv4
-usr/share/xt_geoip/RE.iv6
-usr/share/xt_geoip/RO.iv4
-usr/share/xt_geoip/RO.iv6
-usr/share/xt_geoip/RS.iv4
-usr/share/xt_geoip/RS.iv6
-usr/share/xt_geoip/RU.iv4
-usr/share/xt_geoip/RU.iv6
-usr/share/xt_geoip/RW.iv4
-usr/share/xt_geoip/RW.iv6
-usr/share/xt_geoip/SA.iv4
-usr/share/xt_geoip/SA.iv6
-usr/share/xt_geoip/SB.iv4
-usr/share/xt_geoip/SB.iv6
-usr/share/xt_geoip/SC.iv4
-usr/share/xt_geoip/SC.iv6
-usr/share/xt_geoip/SD.iv4
-usr/share/xt_geoip/SD.iv6
-usr/share/xt_geoip/SE.iv4
-usr/share/xt_geoip/SE.iv6
-usr/share/xt_geoip/SG.iv4
-usr/share/xt_geoip/SG.iv6
-usr/share/xt_geoip/SH.iv4
-usr/share/xt_geoip/SH.iv6
-usr/share/xt_geoip/SI.iv4
-usr/share/xt_geoip/SI.iv6
-usr/share/xt_geoip/SJ.iv4
-usr/share/xt_geoip/SJ.iv6
-usr/share/xt_geoip/SK.iv4
-usr/share/xt_geoip/SK.iv6
-usr/share/xt_geoip/SL.iv4
-usr/share/xt_geoip/SL.iv6
-usr/share/xt_geoip/SM.iv4
-usr/share/xt_geoip/SM.iv6
-usr/share/xt_geoip/SN.iv4
-usr/share/xt_geoip/SN.iv6
-usr/share/xt_geoip/SO.iv4
-usr/share/xt_geoip/SO.iv6
-usr/share/xt_geoip/SR.iv4
-usr/share/xt_geoip/SR.iv6
-usr/share/xt_geoip/SS.iv4
-usr/share/xt_geoip/SS.iv6
-usr/share/xt_geoip/ST.iv4
-usr/share/xt_geoip/ST.iv6
-usr/share/xt_geoip/SV.iv4
-usr/share/xt_geoip/SV.iv6
-usr/share/xt_geoip/SX.iv4
-usr/share/xt_geoip/SX.iv6
-usr/share/xt_geoip/SY.iv4
-usr/share/xt_geoip/SY.iv6
-usr/share/xt_geoip/SZ.iv4
-usr/share/xt_geoip/SZ.iv6
-usr/share/xt_geoip/TC.iv4
-usr/share/xt_geoip/TC.iv6
-usr/share/xt_geoip/TD.iv4
-usr/share/xt_geoip/TD.iv6
-usr/share/xt_geoip/TF.iv4
-usr/share/xt_geoip/TF.iv6
-usr/share/xt_geoip/TG.iv4
-usr/share/xt_geoip/TG.iv6
-usr/share/xt_geoip/TH.iv4
-usr/share/xt_geoip/TH.iv6
-usr/share/xt_geoip/TJ.iv4
-usr/share/xt_geoip/TJ.iv6
-usr/share/xt_geoip/TK.iv4
-usr/share/xt_geoip/TK.iv6
-usr/share/xt_geoip/TL.iv4
-usr/share/xt_geoip/TL.iv6
-usr/share/xt_geoip/TM.iv4
-usr/share/xt_geoip/TM.iv6
-usr/share/xt_geoip/TN.iv4
-usr/share/xt_geoip/TN.iv6
-usr/share/xt_geoip/TO.iv4
-usr/share/xt_geoip/TO.iv6
-usr/share/xt_geoip/TR.iv4
-usr/share/xt_geoip/TR.iv6
-usr/share/xt_geoip/TT.iv4
-usr/share/xt_geoip/TT.iv6
-usr/share/xt_geoip/TV.iv4
-usr/share/xt_geoip/TV.iv6
-usr/share/xt_geoip/TW.iv4
-usr/share/xt_geoip/TW.iv6
-usr/share/xt_geoip/TZ.iv4
-usr/share/xt_geoip/TZ.iv6
-usr/share/xt_geoip/UA.iv4
-usr/share/xt_geoip/UA.iv6
-usr/share/xt_geoip/UG.iv4
-usr/share/xt_geoip/UG.iv6
-usr/share/xt_geoip/UM.iv4
-usr/share/xt_geoip/UM.iv6
-usr/share/xt_geoip/US.iv4
-usr/share/xt_geoip/US.iv6
-usr/share/xt_geoip/UY.iv4
-usr/share/xt_geoip/UY.iv6
-usr/share/xt_geoip/UZ.iv4
-usr/share/xt_geoip/UZ.iv6
-usr/share/xt_geoip/VA.iv4
-usr/share/xt_geoip/VA.iv6
-usr/share/xt_geoip/VC.iv4
-usr/share/xt_geoip/VC.iv6
-usr/share/xt_geoip/VE.iv4
-usr/share/xt_geoip/VE.iv6
-usr/share/xt_geoip/VG.iv4
-usr/share/xt_geoip/VG.iv6
-usr/share/xt_geoip/VI.iv4
-usr/share/xt_geoip/VI.iv6
-usr/share/xt_geoip/VN.iv4
-usr/share/xt_geoip/VN.iv6
-usr/share/xt_geoip/VU.iv4
-usr/share/xt_geoip/VU.iv6
-usr/share/xt_geoip/WF.iv4
-usr/share/xt_geoip/WF.iv6
-usr/share/xt_geoip/WS.iv4
-usr/share/xt_geoip/WS.iv6
-usr/share/xt_geoip/XK.iv4
-usr/share/xt_geoip/XK.iv6
-usr/share/xt_geoip/YE.iv4
-usr/share/xt_geoip/YE.iv6
-usr/share/xt_geoip/YT.iv4
-usr/share/xt_geoip/YT.iv6
-usr/share/xt_geoip/ZA.iv4
-usr/share/xt_geoip/ZA.iv6
-usr/share/xt_geoip/ZM.iv4
-usr/share/xt_geoip/ZM.iv6
-usr/share/xt_geoip/ZW.iv4
-usr/share/xt_geoip/ZW.iv6
-#var/lib/GeoIP
-var/lib/GeoIP/COPYRIGHT.txt
-var/lib/GeoIP/GeoLite2-Country-Blocks-IPv4.csv
-var/lib/GeoIP/GeoLite2-Country-Blocks-IPv6.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-de.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-en.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-es.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-fr.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-ja.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-pt-BR.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-ru.csv
-var/lib/GeoIP/GeoLite2-Country-Locations-zh-CN.csv
-var/lib/GeoIP/LICENSE.txt
-var/lib/GeoIP/README.txt
diff --git a/config/rootfiles/common/geoip-generator b/config/rootfiles/common/geoip-generator
deleted file mode 100644 (file)
index 6ff83c0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#usr/bin/geoiplookup
-#usr/bin/geoiplookup6
-#usr/include/GeoIP.h
-#usr/include/GeoIPCity.h
-#usr/lib/libGeoIP.a
-#usr/lib/libGeoIP.la
-usr/lib/libGeoIP.so
-usr/lib/libGeoIP.so.1
-usr/lib/libGeoIP.so.1.6.12
-#usr/lib/pkgconfig/geoip.pc
-#usr/share/GeoIP/bin
-usr/share/GeoIP/bin/countryInfo.txt
-usr/share/GeoIP/bin/geoip-generator
-usr/share/GeoIP/bin/geolite2-to-legacy-csv.sh
-#usr/share/man/man1/geoiplookup.1
-#usr/share/man/man1/geoiplookup6.1
index 996925b7af372e2f614649dcf490cad93ad33b20..d04eadf722e85211b6d40efa5963ff07149405f5 100644 (file)
@@ -65,7 +65,6 @@ etc/rc.d/init.d/networking/red.up/50-ovpn
 etc/rc.d/init.d/networking/red.up/98-leds
 etc/rc.d/init.d/networking/red.up/99-beep
 etc/rc.d/init.d/networking/red.up/99-fireinfo
-etc/rc.d/init.d/networking/red.up/99-geoip-database
 etc/rc.d/init.d/networking/red.up/99-pakfire-update
 etc/rc.d/init.d/networking/wpa_supplicant.exe
 etc/rc.d/init.d/ntp
diff --git a/config/rootfiles/common/libloc b/config/rootfiles/common/libloc
new file mode 100644 (file)
index 0000000..9035366
--- /dev/null
@@ -0,0 +1,39 @@
+usr/bin/location-downloader
+usr/bin/location-exporter
+#usr/bin/location-importer
+usr/bin/location-query
+#usr/include/libloc
+#usr/include/libloc/as.h
+#usr/include/libloc/compat.h
+#usr/include/libloc/country.h
+#usr/include/libloc/database.h
+#usr/include/libloc/format.h
+#usr/include/libloc/libloc.h
+#usr/include/libloc/network.h
+#usr/include/libloc/private.h
+#usr/include/libloc/resolv.h
+#usr/include/libloc/stringpool.h
+#usr/include/libloc/writer.h
+#usr/lib/libloc.la
+#usr/lib/libloc.so
+usr/lib/libloc.so.0
+usr/lib/libloc.so.0.0.0
+usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/Location.pm
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Location
+#usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Location/.packlist
+usr/lib/perl5/site_perl/5.30.0/xxxMACHINExxx-linux-thread-multi/auto/Location/Location.so
+#usr/lib/pkgconfig/libloc.pc
+#usr/lib/python3.8
+#usr/lib/python3.8/site-packages
+#usr/lib/python3.8/site-packages/_location.la
+usr/lib/python3.8/site-packages/_location.so
+#usr/lib/python3.8/site-packages/location
+usr/lib/python3.8/site-packages/location/__init__.py
+usr/lib/python3.8/site-packages/location/database.py
+usr/lib/python3.8/site-packages/location/i18n.py
+usr/lib/python3.8/site-packages/location/importer.py
+usr/lib/python3.8/site-packages/location/logger.py
+#usr/share/locale/de/LC_MESSAGES/libloc.mo
+#usr/share/man/man3/Location.3
+var/lib/location
+var/lib/location/signing-key.pem
index f5643933577ad9af6d0d5755735a4714866ab6d3..a5967060be993e977f2da78676075d8615276455 100644 (file)
@@ -107,8 +107,7 @@ usr/local/bin/timecheck
 usr/local/bin/timezone-transition
 usr/local/bin/update-lang-cache
 usr/local/bin/update-ids-ruleset
-usr/local/bin/xt_geoip_build
-usr/local/bin/xt_geoip_update
+usr/local/bin/update-location-database
 #usr/local/include
 #usr/local/lib
 #usr/local/lib/sse2
index 996925b7af372e2f614649dcf490cad93ad33b20..d04eadf722e85211b6d40efa5963ff07149405f5 100644 (file)
@@ -65,7 +65,6 @@ etc/rc.d/init.d/networking/red.up/50-ovpn
 etc/rc.d/init.d/networking/red.up/98-leds
 etc/rc.d/init.d/networking/red.up/99-beep
 etc/rc.d/init.d/networking/red.up/99-fireinfo
-etc/rc.d/init.d/networking/red.up/99-geoip-database
 etc/rc.d/init.d/networking/red.up/99-pakfire-update
 etc/rc.d/init.d/networking/wpa_supplicant.exe
 etc/rc.d/init.d/ntp
index 2197ac4aca5131e6977d3744e662cae14ea54b97..7e2ba5bbb11ab4d7e36d69201e4d1361782cf56d 100644 (file)
@@ -109,8 +109,7 @@ usr/local/bin/timecheck
 usr/local/bin/timezone-transition
 usr/local/bin/update-ids-ruleset
 usr/local/bin/update-lang-cache
-usr/local/bin/xt_geoip_build
-usr/local/bin/xt_geoip_update
+usr/local/bin/update-location-database
 #usr/local/include
 #usr/local/lib
 #usr/local/lib/sse2
index cb958ee7ee6689210889afc92a676ecfa618d2ec..a20047c7df785d52c11f3b55467a1b319252b7c8 100644 (file)
@@ -23,11 +23,11 @@ lib/xtables/libxt_quota2.so
 usr/lib/libxt_ACCOUNT_cl.so.0
 usr/lib/libxt_ACCOUNT_cl.so.0.0.0
 #usr/libexec/xtables-addons
-usr/libexec/xtables-addons/xt_geoip_build
-usr/libexec/xtables-addons/xt_geoip_dl
-usr/local/bin/xt_geoip_build
+#usr/libexec/xtables-addons/xt_geoip_build
+#usr/libexec/xtables-addons/xt_geoip_dl
 usr/sbin/iptaccount
 #usr/share/man/man1/xt_geoip_build.1
 #usr/share/man/man1/xt_geoip_dl.1
 #usr/share/man/man8/iptaccount.8
 #usr/share/man/man8/xtables-addons.8
+/usr/share/xt_geoip/
index 7399fea3cf395ffb181e849e9cfaff21dcc2ee2e..c27ff2ef761a70bebb550fd49e029ced97355cb9 100644 (file)
@@ -86,6 +86,9 @@ if ( $debug ){
 my @dummy = ( ${Header::table1colour} );
 undef (@dummy);
 
+# Init libloc database connection.
+my $libloc_db_handle = &GeoIP::init();
+
 # check sorting arguments
 if ( $cgiin{'sort_field'} ~~ [ '1','2','3','4','5','6','7','8','9' ] ) {
        $SORT_FIELD = $cgiin{'sort_field'};
@@ -551,9 +554,9 @@ foreach my $line (@conntrack) {
        my $bytes_out = format_bytes($bytes[1]);
 
        # enumerate GeoIP information
-       my $srcccode = &GeoIP::lookup($sip_ret);
+       my $srcccode = &GeoIP::lookup_country_code($libloc_db_handle, $sip_ret);
        my $src_flag_icon = &GeoIP::get_flag_icon($srcccode);
-       my $dstccode = &GeoIP::lookup($dip_ret);
+       my $dstccode = &GeoIP::lookup_country_code($libloc_db_handle, $dip_ret);
        my $dst_flag_icon = &GeoIP::get_flag_icon($dstccode);
 
        # Format TTL
index b756a24d2a5e97e67434ecdeb2acbe11763f1f9b..abe8a0b91b4b6f40d167a3f057b5514a1f13c4ef 100644 (file)
@@ -41,33 +41,54 @@ my %cgiparams=();
 my @lines=();
 my $extraquery='';
 
+# Hash which contains the whois servers from
+# the responisible RIR of the continent.
+my %whois_servers_by_continent = (
+       "AF" => "whois.afrinic.net",
+       "AS" => "whois.apnic.net",
+       "EU" => "whois.ripe.net",
+       "NA" => "whois.arin.net",
+       "SA" => "whois.lacnic.net"
+);
+
+# Default whois server if no continent could be determined.
+my $whois_server = "whois.arin.net";
+
 my $addr = CGI::param("ip") || "";
 
 if (&General::validip($addr)) {
-       $extraquery='';
-       @lines=();
-       my $whoisname = "whois.arin.net";
        my $iaddr = inet_aton($addr);
        my $hostname = gethostbyaddr($iaddr, AF_INET);
        if (!$hostname) { $hostname = $Lang::tr{'lookup failed'}; }
 
        # enumerate GeoIP information for IP address...
-       my $ccode = &GeoIP::lookup($addr);
+       my $db_handle = &GeoIP::init();
+       my $ccode = &GeoIP::lookup_country_code($db_handle, $addr);
+
+       # Try to get the continent of the country code.
+       my $continent = &GeoIP::get_continent_code($db_handle, $ccode);
+
+       # Check if a whois server for the continent is known.
+       if($whois_servers_by_continent{$continent}) {
+               # Use it.
+               $whois_server = $whois_servers_by_continent{$continent};
+       }
+
        my $flag_icon = &GeoIP::get_flag_icon($ccode);
 
-       my $sock = new IO::Socket::INET ( PeerAddr => $whoisname, PeerPort => 43, Proto => 'tcp');
+       my $sock = new IO::Socket::INET ( PeerAddr => $whois_server, PeerPort => 43, Proto => 'tcp');
        if ($sock)
        {
-               print $sock "$addr\n";
+               print $sock "$addr\n";
                while (<$sock>) {
-                       $extraquery = $1 if (/ReferralServer: whois:\/\/(\S+)\s+/);
+                       $extraquery = $1 if (/ReferralServer:  whois:\/\/(\S+)\s+/);
                        push(@lines,$_);
                }
                close($sock);
                if ($extraquery) {
                        undef (@lines);
-                       $whoisname = $extraquery;
-                       my $sock = new IO::Socket::INET ( PeerAddr => $whoisname, PeerPort => 43, Proto => 'tcp');
+                       $whois_server = $extraquery;
+                       my $sock = new IO::Socket::INET ( PeerAddr => $whois_server, PeerPort => 43, Proto => 'tcp');
                        if ($sock)
                        {
                                print $sock "$addr\n";
@@ -77,16 +98,16 @@ if (&General::validip($addr)) {
                        }
                        else
                        {
-                               @lines = ( "$Lang::tr{'unable to contact'} $whoisname" );
+                               @lines = ( "$Lang::tr{'unable to contact'} $whois_server" );
                        }
                }
        }
        else
        {
-               @lines = ( "$Lang::tr{'unable to contact'} $whoisname" );
+               @lines = ( "$Lang::tr{'unable to contact'} $whois_server" );
        }
 
-       &Header::openbox('100%', 'left', $addr . " <a href='country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode' /></a> (" . $hostname . ') : '.$whoisname);
+       &Header::openbox('100%', 'left', $addr . " <a href='country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode' /></a> (" . $hostname . ') : '.$whois_server);
        print "<pre>\n";
        foreach my $line (@lines) {
                print &Header::cleanhtml($line,"y");
index e67a40a9f506d4712c3ac1255c38b4e54f5938aa..6d07b62844e72c0259733540e3ccfe8bb26decf7 100644 (file)
@@ -24,6 +24,9 @@ require "${General::swroot}/geoip-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+# Libloc database handle.
+my $libloc_db_handle = &GeoIP::init();
+
 my %color = ();
 my %mainsettings = ();
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
@@ -351,7 +354,7 @@ foreach $_ (@log)
        $srcport=$1 if $packet =~ /SPT=(\d+)/;
        $dstport=$1 if $packet =~ /DPT=(\d+)/;
 
-       my $ccode = &GeoIP::lookup($srcaddr);
+       my $ccode = &GeoIP::lookup_country_code($libloc_db_handle, $srcaddr);
 
        my $servi = uc(getservbyport($srcport, lc($proto)));
        if ($servi ne '' && $srcport < 1024) {
index 949f2599daade08aa40d9285a3c754bccf419c95..c241b032054e6fdfecb44b3c65b9f93647872c97 100644 (file)
@@ -22,6 +22,9 @@ require "${General::swroot}/geoip-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+# Libloc database handle.
+my $libloc_db_handle = &GeoIP::init();
+
 use POSIX();
 
 my %cgiparams=();
@@ -308,7 +311,7 @@ foreach $_ (@log)
                # Traffic from red
                if($srcaddr ne '') {
                        # srcaddr is set
-                       my $ccode = &GeoIP::lookup($srcaddr);
+                       my $ccode = &GeoIP::lookup_country_code($libloc_db_handle, $srcaddr);
                        if ($ccode eq '') {
                                $ccode = 'unknown';
                        }
index c73d24fd663fee6af86ff0cc31e669f7acf217b0..7b117deabec36e225f7f18d0e350b194ecae68b1 100644 (file)
@@ -22,6 +22,9 @@ require "${General::swroot}/geoip-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+# Libloc database handle.
+my $libloc_db_handle = &GeoIP::init();
+
 use POSIX();
 
 my %cgiparams=();
@@ -435,7 +438,7 @@ for($s=0;$s<$lines;$s++)
        $col="bgcolor='$color{\"color$colorIndex\"}'";
        print "<tr>";
 
-       my $ccode = &GeoIP::lookup($key[$s]);
+       my $ccode = &GeoIP::lookup_country_code($libloc_db_handle, $key[$s]);
   
        $color++;
        print "<td align='center' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
index 69835370b154acdaf8676bbd28640726497e70d4..2af0ec9dcc73eccf58ed77a587089f2c618dc874 100644 (file)
@@ -19,6 +19,9 @@ require "${General::swroot}/geoip-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+# Libloc database handle.
+my $libloc_db_handle = &GeoIP::init();
+
 use POSIX();
 
 #workaround to suppress a warning when a variable is used only once
@@ -178,7 +181,7 @@ if (!$skip)
                        }
                        elsif($srcaddr ne '') {
                                # or srcaddr matches country code
-                               my $ccode = &GeoIP::lookup($srcaddr);
+                               my $ccode = &GeoIP::lookup_country_code($libloc_db_handle, $srcaddr);
                                if($ccode eq uc($country)){
                                        $log[$lines] = $_;
                                        $lines++;
@@ -349,7 +352,7 @@ foreach $_ (@slice)
        if($iface eq $country || $srcaddr ne '') {
                my $ccode='';
                if($iface ne $country) {
-                       $ccode = &GeoIP::lookup($srcaddr);
+                       $ccode = &GeoIP::lookup_country_code($libloc_db_handle, $srcaddr);
                }
                if($iface eq $country || $ccode eq uc($country)) {
                        my $chain = '';
index 98ac4fe128752679c3a1d5d136473060e3c39c6e..731fa3f44b0a221231c193eb88d7c1899a05d618 100644 (file)
@@ -34,6 +34,9 @@ require "${General::swroot}/header.pl";
 require "${General::swroot}/geoip-functions.pl";
 require "${General::swroot}/graphs.pl";
 
+# Libloc database handle.
+my $libloc_db_handle = &GeoIP::init();
+
 my %color = ();
 my %mainsettings = ();
 my %netsettings=();
index bcd51df6d0bdac25b59b1092c0f639d0d3baed47..23bbf40757b7f7b4e66958b46b943efcfb732934 100644 (file)
@@ -2994,6 +2994,9 @@ END
        &Header::openbigbox('100%', 'LEFT', '', '');
     &Header::openbox('100%', 'LEFT', $Lang::tr{'ovpn con stat'});
 
+    # Libloc database handle.
+    my $libloc_db_handle = &GeoIP::init();
+
 #
 #      <td><b>$Lang::tr{'protocol'}</b></td>
 # protocol temp removed 
@@ -3044,7 +3047,7 @@ END
                    $users[$uid]{'Proto'} = $proto;
 
                    # get country code for "RealAddress"...
-                   my $ccode = &GeoIP::lookup((split ':', $users[$uid]{'RealAddress'})[0]);
+                   my $ccode = &GeoIP::lookup_country_code($libloc_db_handle, (split ':', $users[$uid]{'RealAddress'})[0]);
                    my $flag_icon = &GeoIP::get_flag_icon($ccode);
                    $users[$uid]{'Country'} = "<a href='country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode' /></a>";
                    $uid++;
index 8beb84efa736aac3af9a4b6574f8adfe029e52bb..d94d27d42563730b90b34f9bf2203cfcf56289ae 100644 (file)
@@ -278,6 +278,9 @@ sub printactivelogins()
        } else {
                # list active logins...
 
+               # Libloc database handle.
+               my $libloc_db_handle = &GeoIP::init();
+
                foreach my $line (@output)
                {
                        my @arry = split(/\ +/, $line);
@@ -288,7 +291,7 @@ sub printactivelogins()
                        $remoteip =~ s/[()]//g;
 
                        # display more information about that IP adress...
-                       my $ccode = &GeoIP::lookup($remoteip);
+                       my $ccode = &GeoIP::lookup_country_code($libloc_db_handle, $remoteip);
                        my $flag_icon = &GeoIP::get_flag_icon($ccode);
 
                        # get rDNS...
index 55482a980a2addb25d9ea43c273ada04ef5f2bd4..1f9323ee03ab9f9d6b805c7ec2ddeaf6a3a0e683 100644 (file)
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 3.33
+VER        = 3.62
 
 THISAPP    = Locale-Codes-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = bc7496f97889de8504e80addaa0ee40c
+$(DL_FILE)_MD5 = d4ee6fb8b5483c54abde1aa2b94e555a
 
 install : $(TARGET)
 
diff --git a/lfs/geoip-database b/lfs/geoip-database
deleted file mode 100644 (file)
index fbaa211..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-###############################################################################
-#                                                                             #
-# IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2020  IPFire Team  <info@ipfire.org>                     #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-###############################################################################
-# Definitions
-###############################################################################
-
-include Config
-
-VER        = 20191217
-
-THISAPP    = GeoIP-LiteCity-1-2csv-xtables-$(VER)
-DL_FILE    = $(THISAPP).tar.xz
-DL_FROM    = $(URL_IPFIRE)
-DIR_APP    = $(DIR_SRC)/$(THISAPP)
-TARGET     = $(DIR_INFO)/$(THISAPP)
-
-###############################################################################
-# Top-level Rules
-###############################################################################
-
-objects = $(DL_FILE)
-
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5                  = 6265289716880fd8e8a6061fef8d5747
-
-install : $(TARGET)
-
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
-download :$(patsubst %,$(DIR_DL)/%,$(objects))
-
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
-       @$(CHECK)
-
-$(patsubst %,$(DIR_DL)/%,$(objects)) :
-       @$(LOAD)
-
-$(subst %,%_MD5,$(objects)) :
-       @$(MD5)
-
-###############################################################################
-# Installation Details
-###############################################################################
-
-$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
-       @$(PREBUILD)
-       @cd / && tar axf $(DIR_DL)/$(DL_FILE)
-       @$(POSTBUILD)
diff --git a/lfs/geoip-generator b/lfs/geoip-generator
deleted file mode 100644 (file)
index 3091d32..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-###############################################################################
-#                                                                             #
-# IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2018  IPFire Team  <info@ipfire.org>                     #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-###############################################################################
-# Definitions
-###############################################################################
-
-include Config
-
-VER        = 1.6.12
-DVER       = 1.6.12-3
-
-THISAPP    = geoip-api-c-$(VER)
-DL_FILE    = $(THISAPP).tar.gz
-DL_FROM    = $(URL_IPFIRE)
-DIR_APP    = $(DIR_SRC)/$(THISAPP)
-TARGET     = $(DIR_INFO)/$(THISAPP)
-
-###############################################################################
-# Top-level Rules
-###############################################################################
-
-objects = $(DL_FILE) geoip_$(DVER).debian.tar.xz
-
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE) 
-geoip_$(DVER).debian.tar.xz = $(DL_FROM)/geoip_$(DVER).debian.tar.xz
-
-$(DL_FILE)_MD5                  = 727e5d6df9e9fc039dbc3a323cc56d2e
-geoip_$(DVER).debian.tar.xz_MD5 = 64fb561362dc456b45b799da20d47dd4
-
-install : $(TARGET)
-
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
-download :$(patsubst %,$(DIR_DL)/%,$(objects))
-
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
-       @$(CHECK)
-
-$(patsubst %,$(DIR_DL)/%,$(objects)) :
-       @$(LOAD)
-
-$(subst %,%_MD5,$(objects)) :
-       @$(MD5)
-
-###############################################################################
-# Installation Details
-###############################################################################
-
-$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
-       @$(PREBUILD)
-       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && ./bootstrap
-       cd $(DIR_APP) && ./configure --prefix=/usr
-       cd $(DIR_APP) && make $(MAKETUNING)
-       cd $(DIR_APP) && make install
-       cd $(DIR_APP) && tar axf $(DIR_DL)/geoip_$(DVER).debian.tar.xz
-       cd $(DIR_APP) && sed -i "s/use diagnostics;//g" debian/src/geolite2-to-legacy-csv.sh
-       cd $(DIR_APP) && g++ -std=gnu++11 -g debian/src/geoip-csv-to-dat.cpp \
-                               -o geoip-generator -lGeoIP
-       -mkdir -p /usr/share/GeoIP/bin
-       cd $(DIR_APP) && install -m 755 geoip-generator /usr/share/GeoIP/bin
-       cd $(DIR_APP) && install -m 755 debian/src/geolite2-to-legacy-csv.sh /usr/share/GeoIP/bin
-       cd $(DIR_APP) && install -m 644 debian/src/countryInfo.txt /usr/share/GeoIP/bin
-       @rm -rf $(DIR_APP)
-       @$(POSTBUILD)
similarity index 77%
rename from lfs/GeoIP
rename to lfs/libloc
index ce758d8a53d292f5cbaa80b6b06974259559cf80..8e8d539a75f5ee7b019f1e5607487e041a1dc91f 100644 (file)
--- a/lfs/GeoIP
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2018  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2019  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
 
 include Config
 
-VER        = 1.25
-DATVER     = 30062018
+VER        = 0.9.1
 
-THISAPP    = Geo-IP-PurePerl-$(VER)
+THISAPP    = libloc-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
 DL_FROM    = $(URL_IPFIRE)
-DIR_APP    = $(DIR_SRC)/$(THISAPP)
+DIR_APP    = $(DIR_SRC)/libloc-$(VER)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 
 ###############################################################################
 # Top-level Rules
 ###############################################################################
 
-objects = $(DL_FILE) GeoIP.dat-$(DATVER).gz
+objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-GeoIP.dat-$(DATVER).gz = $(DL_FROM)/GeoIP.dat-$(DATVER).gz
-
-$(DL_FILE)_MD5 = a47a1b71f7cd7c46cca9efcc448e0726
-GeoIP.dat-$(DATVER).gz_MD5 = d538e57ad9268fdc7955c6cf9a37c4a9
 
+$(DL_FILE)_MD5 = b62331e7a5bc5299bdd35f340342fc51
 install : $(TARGET)
 
 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
@@ -53,6 +49,9 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
 
 md5 : $(subst %,%_MD5,$(objects))
 
+dist:
+       @$(PAK)
+
 ###############################################################################
 # Downloading, checking, md5sum
 ###############################################################################
@@ -72,13 +71,19 @@ $(subst %,%_MD5,$(objects)) :
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
-       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/geoip_1_25_change_database_path.patch
-       cd $(DIR_APP) && perl Makefile.PL
-       cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xvf $(DIR_DL)/$(DL_FILE)
+
+       # Add upstream patches.
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/libloc-0.9.1-location-downloader-do-not-change-content-of-open-database.patch
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/libloc-0.9.1-remove-python-path-overrides-for-debian.patch
+
+       cd $(DIR_APP) && ./autogen.sh
+       cd $(DIR_APP) && ./configure \
+               --prefix=/usr \
+               --sysconfdir=/etc \
+               --localstatedir=/var \
+               --disable-manpages
+       cd $(DIR_APP) && make $(MAKETUNING)
        cd $(DIR_APP) && make install
-       cd $(DIR_APP) && mkdir -p /usr/share/GeoIP && \
-               zcat $(DIR_DL)/GeoIP.dat-$(DATVER).gz > /usr/share/GeoIP/GeoIP.dat
-       cd $(DIR_APP) && chmod 777 /srv/web/ipfire/html/images/flags
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index 651a13f9c511eca117e5e5783b185419d80b6edf..08b1e070f8075a7a351223941c18a0b65365e30f 100644 (file)
@@ -27,7 +27,7 @@ include Config
 VERSUFIX = ipfire$(KCFG)
 MODPATH = /lib/modules/$(KVER)-$(VERSUFIX)/extra/
 
-VER        = 3.2
+VER        = 3.7
 
 THISAPP    = xtables-addons-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -48,7 +48,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 80ea89ba8d5a001a8d71c7f05b2f0141
+$(DL_FILE)_MD5 = d81776d6320ebd741042bf8eb7e13d1d
 
 install : $(TARGET)
 
@@ -82,8 +82,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
 
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/xtables-addons-3.2-fix-database-generation.patch
-
        # Only build the specified modules.
        cp -avf $(DIR_SRC)/config/xtables-addons/mconfig \
                $(DIR_APP)/mconfig
@@ -96,10 +94,6 @@ ifeq "$(USPACE)" "1"
 
        cd $(DIR_APP) && make $(MAKETUNING)
        cd $(DIR_APP) && make install
-
-       # Install xt_geoip_build.
-       cd $(DIR_APP) && install -m 755 geoip/xt_geoip_build \
-               /usr/local/bin/
 else
        cd $(DIR_APP) && ./configure \
                --with-kbuild=/lib/modules/$$(uname -r)$(KCFG)/build
@@ -117,5 +111,8 @@ else
        done
 endif
 
+       # Create directory for the databases.
+       mkdir -pv /usr/share/xt_geoip/
+
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/make.sh b/make.sh
index 5ed15a0f5ad83fcef2f84b182ed3ddf489407360..fef920ef7ee7c0d849c122f44e8dfb309c59fd16 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1346,8 +1346,6 @@ buildipfire() {
   lfsmake2 python-daemon
   lfsmake2 python-ipaddress
   lfsmake2 glib
-  lfsmake2 GeoIP
-  lfsmake2 geoip-database
   lfsmake2 ntp
   lfsmake2 openssh
   lfsmake2 fontconfig
@@ -1634,10 +1632,10 @@ buildipfire() {
   lfsmake2 flashrom
   lfsmake2 firmware-update
   lfsmake2 tshark
-  lfsmake2 geoip-generator
   lfsmake2 speedtest-cli
   lfsmake2 rfkill
   lfsmake2 amazon-ssm-agent
+  lfsmake2 libloc
 }
 
 buildinstaller() {
@@ -1990,3 +1988,4 @@ find-dependencies)
        cat doc/make.sh-usage
        ;;
 esac
+
diff --git a/src/initscripts/networking/red.up/99-geoip-database b/src/initscripts/networking/red.up/99-geoip-database
deleted file mode 100644 (file)
index 9b024a8..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-# Get the GeoIP database if no one exists yet
-
-database_exists() {
-       local file
-       for file in /usr/share/xt_geoip/*.iv4; do
-               [ -e "${file}" ] && return 0
-       done
-
-       # Does not exist
-       return 1
-}
-
-# Download ruleset if none has been found.
-if ! database_exists; then
-       /usr/local/bin/xt_geoip_update >/dev/null 2>&1 &
-fi
-
-exit 0
diff --git a/src/patches/geoip_1_25_change_database_path.patch b/src/patches/geoip_1_25_change_database_path.patch
deleted file mode 100644 (file)
index 933e93d..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
---- lib/Geo/IP/PurePerl.pm     Tue Mar 30 15:41:34 2010
-+++ lib/Geo/IP/PurePerl.pm     Mon Jan 09 18:58:11 2017
-@@ -129,7 +129,7 @@
- # --- unfortunately we do not know the path so we assume the 
--# default path /usr/local/share/GeoIP
-+# default path /usr/share/GeoIP
- # if thats not true, you can set $Geo::IP::PurePerl::OPEN_TYPE_PATH
- #
- sub open_type {
-@@ -210,7 +210,7 @@
-   # this will be less messy once deprecated new( $path, [$flags] )
-   # is no longer supported (that's what open() is for)
--  my $def_db_file = '/usr/local/share/GeoIP/GeoIP.dat';
-+  my $def_db_file = '/usr/share/GeoIP/GeoIP.dat';
-     if ($^O eq 'NetWare') {
-     $def_db_file = 'sys:/etc/GeoIP/GeoIP.dat';
-   } elsif ($^O eq 'MSWin32') {
-@@ -758,7 +758,7 @@
- =item $gi = Geo::IP->new( [$flags] );
- Constructs a new Geo::IP object with the default database located inside your system's
--I<datadir>, typically I</usr/local/share/GeoIP/GeoIP.dat>.
-+I<datadir>, typically I</usr/share/GeoIP/GeoIP.dat>.
- Flags can be set to either GEOIP_STANDARD, or for faster performance
- (at a cost of using more memory), GEOIP_MEMORY_CACHE.
---- t/1_lookup.t       Tue Mar 30 15:13:37 2010
-+++ t/1_lookup.t       Mon Jan 09 18:58:13 2017
-@@ -2,7 +2,7 @@
- use vars qw($dat);
- BEGIN {
--  foreach my $file ("GeoIP.dat",'/usr/local/share/GeoIP/GeoIP.dat') {
-+  foreach my $file ("GeoIP.dat",'/usr/share/GeoIP/GeoIP.dat') {
-     if (-f $file) {
-       $dat = $file;
-       last;
---- t/2_namelookup.t   Tue Mar 30 15:21:37 2010
-+++ t/2_namelookup.t   Mon Jan 09 18:58:21 2017
-@@ -2,7 +2,7 @@
- use vars qw($dat);
- BEGIN {
--  foreach my $file ("GeoIP.dat",'/usr/local/share/GeoIP/GeoIP.dat') {
-+  foreach my $file ("GeoIP.dat",'/usr/share/GeoIP/GeoIP.dat') {
-     if (-f $file) {
-       $dat = $file;
-       last;
---- Changes    Tue Mar 30 15:26:38 2010
-+++ Changes    Mon Jan 09 18:57:37 2017
-@@ -35,7 +35,7 @@
-       Country, City and Org requests benefit from GEOIP_MEMORY_CACHE and GEOIP_MMAP_CACHE
-       Add GEOIP_MMAP_CACHE support ( Peter Shipley ) 
-       Now works with new format of GeoIP ISP
--      Corrected path to /usr/local/share/GeoIP/GeoIP.dat in geoip-lookup program.
-+      Corrected path to /usr/share/GeoIP/GeoIP.dat in geoip-lookup program.
- 1.18  January 8th 2007
-       Replaced CS/Serbia and Montenegro with RS/Serbia, removed ZR/Zaire, added ME/Montenegro
---- geoip-lookup       Tue Mar 30 15:13:36 2010
-+++ geoip-lookup       Mon Jan 09 18:57:44 2017
-@@ -15,7 +15,7 @@
- The I<geoip-lookup> program will return the country for the IP address or
- hostname given as the first command line argument.
--It queries the GeoIP Country database in C</usr/local/share/GeoIP/GeoIP.dat>.
-+It queries the GeoIP Country database in C</usr/share/GeoIP/GeoIP.dat>.
- By default it prints the ISO 3166 country code.  Use the C<-l> option
- to print the country name.
---- geoip-lookup-city  Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-city  Mon Jan 09 18:57:48 2017
-@@ -6,7 +6,7 @@
- my $addr = shift;
--my $gi = Geo::IP::PurePerl->new( "/usr/local/share/GeoIP/GeoIPCity.dat",
-+my $gi = Geo::IP::PurePerl->new( "/usr/share/GeoIP/GeoIPCity.dat",
-                                  GEOIP_STANDARD );
- if ($addr) {
---- geoip-lookup-isp   Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-isp   Mon Jan 09 18:57:50 2017
-@@ -7,7 +7,7 @@
- my $addr = shift;
--my $gi = Geo::IP::PurePerl->new("/usr/local/share/GeoIP/GeoIPISP.dat",GEOIP_STANDARD);
-+my $gi = Geo::IP::PurePerl->new("/usr/share/GeoIP/GeoIPISP.dat",GEOIP_STANDARD);
- my $isp = $gi->org_by_name($addr);
---- geoip-lookup-netspeed      Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-netspeed      Mon Jan 09 18:57:53 2017
-@@ -6,7 +6,7 @@
- my $addr = $ARGV[0];
--my $gi = Geo::IP::PurePerl->new("/usr/local/share/GeoIP/GeoIPNetSpeed.dat",GEOIP_STANDARD);
-+my $gi = Geo::IP::PurePerl->new("/usr/share/GeoIP/GeoIPNetSpeed.dat",GEOIP_STANDARD);
- my $netspeed = $gi->id_by_addr($addr);
---- geoip-lookup-org   Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-org   Mon Jan 09 18:57:59 2017
-@@ -7,7 +7,7 @@
- my $addr = shift;
--my $gi = Geo::IP::PurePerl->new("/usr/local/share/GeoIP/GeoIPOrg.dat",GEOIP_STANDARD);
-+my $gi = Geo::IP::PurePerl->new("/usr/share/GeoIP/GeoIPOrg.dat",GEOIP_STANDARD);
- my $org = $gi->org_by_name($addr);
---- geoip-lookup-region        Tue Mar 30 15:13:36 2010
-+++ geoip-lookup-region        Mon Jan 09 18:58:01 2017
-@@ -10,7 +10,7 @@
- my $addr = $ARGV[0];
--my $gi = Geo::IP::PurePerl->new("/usr/local/share/GeoIP/GeoIPRegion.dat",GEOIP_STANDARD);
-+my $gi = Geo::IP::PurePerl->new("/usr/share/GeoIP/GeoIPRegion.dat",GEOIP_STANDARD);
- my ($country,$region) = $gi->region_by_name($addr);
---- INSTALL    Tue Mar 30 15:13:36 2010
-+++ INSTALL    Mon Jan 09 18:58:05 2017
-@@ -3,7 +3,7 @@
- # fetch latest GeoIP database, updated monthly
- wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
- gunzip GeoIP.dat.gz
--mv GeoIP.dat /usr/local/share/GeoIP/GeoIP.dat
-+mv GeoIP.dat /usr/share/GeoIP/GeoIP.dat
- perl Makefile.PL
- make
diff --git a/src/patches/libloc-0.9.1-location-downloader-do-not-change-content-of-open-database.patch b/src/patches/libloc-0.9.1-location-downloader-do-not-change-content-of-open-database.patch
new file mode 100644 (file)
index 0000000..857ab5c
--- /dev/null
@@ -0,0 +1,81 @@
+commit 679e5ae2e45b98e254c651cb3102a4331c2c22eb
+Author: Michael Tremer <michael.tremer@ipfire.org>
+Date:   Mon Jun 1 13:47:44 2020 +0000
+
+    location-downloader: Do not change content of open database files
+    
+    The database might be opened by another process. When modified,
+    it will return random results.
+    
+    Fixes: #12420
+    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
+
+diff --git a/src/python/location-downloader.in b/src/python/location-downloader.in
+index 7d06030..bf0d682 100644
+--- a/src/python/location-downloader.in
++++ b/src/python/location-downloader.in
+@@ -24,6 +24,7 @@ import lzma
+ import os
+ import random
+ import shutil
++import stat
+ import sys
+ import tempfile
+ import time
+@@ -116,7 +117,7 @@ class Downloader(object):
+               return res
+-      def download(self, url, public_key, timestamp=None, **kwargs):
++      def download(self, url, public_key, timestamp=None, tmpdir=None, **kwargs):
+               headers = {}
+               if timestamp:
+@@ -124,7 +125,7 @@ class Downloader(object):
+                               "%a, %d %b %Y %H:%M:%S GMT",
+                       )
+-              t = tempfile.NamedTemporaryFile(delete=False)
++              t = tempfile.NamedTemporaryFile(dir=tmpdir, delete=False)
+               with t:
+                       # Try all mirrors
+                       for mirror in self.mirrors:
+@@ -175,6 +176,9 @@ class Downloader(object):
+                                               t.truncate()
+                                               continue
++                                      # Make the file readable for everyone
++                                      os.chmod(t.name, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)
++
+                                       # Return temporary file
+                                       return t
+@@ -296,10 +300,13 @@ class CLI(object):
+               except FileNotFoundError as e:
+                       db = None
++              # Download the database into the correct directory
++              tmpdir = os.path.dirname(ns.database)
++
+               # Try downloading a new database
+               try:
+                       t = self.downloader.download("%s/%s" % (self.version, DATABASE_FILENAME),
+-                              public_key=ns.public_key, timestamp=timestamp)
++                              public_key=ns.public_key, timestamp=timestamp, tmpdir=tmpdir)
+               # If no file could be downloaded, log a message
+               except FileNotFoundError as e:
+@@ -310,11 +317,8 @@ class CLI(object):
+               if not t:
+                       return 3
+-              # Write temporary file to destination
+-              shutil.copyfile(t.name, ns.database)
+-
+-              # Remove temporary file
+-              os.unlink(t.name)
++              # Move temporary file to destination
++              shutil.move(t.name, ns.database)
+               return 0
diff --git a/src/patches/libloc-0.9.1-remove-python-path-overrides-for-debian.patch b/src/patches/libloc-0.9.1-remove-python-path-overrides-for-debian.patch
new file mode 100644 (file)
index 0000000..0656a03
--- /dev/null
@@ -0,0 +1,37 @@
+commit 9df8db2ae6268b0901961625fd27b4dde1ed451f
+Author: Michael Tremer <michael.tremer@ipfire.org>
+Date:   Mon Jun 1 18:23:50 2020 +0000
+
+    Makefile: Remove Python path overrides for Debian
+    
+    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
+
+diff --git a/Makefile.am b/Makefile.am
+index 570ec3a..31869e0 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -54,10 +54,6 @@ SED_PROCESS = \
+ databasedir = $(localstatedir)/lib/location
+ pkgconfigdir = $(libdir)/pkgconfig
+-# XXX hardcode path for Debian
+-pythondir = $(prefix)/lib/python3/dist-packages
+-pyexecdir = $(prefix)/lib/python$(PYTHON_VERSION)/lib-dynload
+-
+ # Overwrite Python path
+ pkgpythondir = $(pythondir)/location
+diff --git a/debian/libloc.install b/debian/libloc.install
+index eb3b49a..30bbeca 100644
+--- a/debian/libloc.install
++++ b/debian/libloc.install
+@@ -2,8 +2,7 @@ usr/bin/location-downloader
+ usr/bin/location-exporter
+ usr/bin/location-query
+ usr/lib/*/libloc.so.*
+-usr/lib/python3*/dist-packages
+-usr/lib/python3*/lib-dynload/*.so
++usr/lib/python3*/site-packages
+ src/systemd/*.service         /lib/systemd/system/
+ src/systemd/*.timer           /lib/systemd/system/
+ var/lib/location/signing-key.pem
diff --git a/src/patches/xtables-addons-3.2-fix-database-generation.patch b/src/patches/xtables-addons-3.2-fix-database-generation.patch
deleted file mode 100644 (file)
index 5574e20..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/geoip/xt_geoip_build b/geoip/xt_geoip_build
-index 3b15875..7bc42f3 100755
---- a/geoip/xt_geoip_build
-+++ b/geoip/xt_geoip_build
-@@ -259,7 +259,12 @@ sub writeCountry
-               my ($start, $end) = split('-', $range);
-               $start = inet_pton($family, $start);
-               $end = inet_pton($family, $end);
--              print $fh $start, $end;
-+
-+              if ($family == AF_INET) {
-+                      print $fh substr($start, 0, 4), substr($end, 0, 4);
-+              } else {
-+                      print $fh $start, $end;
-+              }
-       }
-       close $fh;
- }
diff --git a/src/scripts/update-location-database b/src/scripts/update-location-database
new file mode 100644 (file)
index 0000000..a329c4c
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/bash
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2019 IPFire Development Team <info@ipfire.org>                #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+eval $(/usr/local/bin/readhash /var/ipfire/proxy/settings)
+
+# Proxy settings.
+# Check if a proxy should be used.
+if [[ $UPSTREAM_PROXY ]]; then
+       PROXYSETTINGS="https_proxy=http://"
+
+       # Check if authentication against the proxy is configured.
+       if [[ $UPSTREAM_USER && $UPSTREAM_PASSWORD ]]; then
+               PROXYSETTINGS="$PROXYSETTINGS$UPSTREAM_USER:$UPSTREAM_PASSWORD@"
+       fi
+
+       # Add proxy server.
+       PROXYSETTINGS="$PROXYSETTINGS$UPSTREAM_PROXY"
+
+       # Export proxy settings.
+       export HTTPS_PROXY="$PROXYSETTINGS"
+fi
+
+# Get the latest location database from server.
+if /usr/bin/location-downloader update; then
+
+       # Call initscript to reload the firewall.
+       /etc/init.d/firewall reload
+fi
diff --git a/src/scripts/xt_geoip_update b/src/scripts/xt_geoip_update
deleted file mode 100644 (file)
index ebd2665..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/bin/bash
-###############################################################################
-#                                                                             #
-# IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2019 IPFire Development Team <info@ipfire.org>                #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-TMP_PATH=$(mktemp -dp /var/tmp)
-TMP_FILE=$(mktemp -p $TMP_PATH)
-
-SCRIPT_PATH=/usr/local/bin
-DEST_PATH=/usr/share/xt_geoip
-DB_PATH=/var/lib/GeoIP
-DB1_PATH=/usr/share/GeoIP
-
-DL_URL=https://geolite.maxmind.com/download/geoip/database
-DL_FILE=GeoLite2-Country-CSV.zip
-
-eval $(/usr/local/bin/readhash /var/ipfire/proxy/settings)
-
-function download() {
-       echo "Downloading latest GeoIP ruleset..."
-
-       # Proxy settings.
-       # Check if a proxy should be used.
-       if [[ $UPSTREAM_PROXY ]]; then
-               PROXYSETTINGS="-e https_proxy=http://"
-
-               # Check if authentication against the proxy is configured.
-               if [[ $UPSTREAM_USER && $UPSTREAM_PASSWORD ]]; then
-                       PROXYSETTINGS="$PROXYSETTINGS$UPSTREAM_USER:$UPSTREAM_PASSWORD@"
-               fi
-
-               # Add proxy server.
-               PROXYSETTINGS="$PROXYSETTINGS$UPSTREAM_PROXY"
-       fi
-
-       # Get the latest GeoIP database from server.
-       wget $DL_URL/$DL_FILE $PROXYSETTINGS -O $TMP_FILE
-
-       # Extract files to database path.
-       unzip $TMP_FILE -d $TMP_PATH
-
-       return 0
-}
-
-function install() {
-       echo "Install CSV database..."
-
-       # Check if the database dir exists.
-       if [ ! -e "$DB_PATH" ]; then
-               mkdir -p $DB_PATH &>/dev/null
-       fi
-
-       # Check if the directory for binary databases exists.
-        if [ ! -e "$DEST_PATH" ]; then
-                mkdir -p $DEST_PATH &>/dev/null
-        fi
-
-       # Install CSV databases.
-       if ! cp -af $TMP_PATH/*/* $DB_PATH &>/dev/null; then
-               echo "Could not copy files. Aborting." >&2
-               return 1
-       fi
-
-       return 0
-}
-
-function build_legacy() {
-       echo "Convert database to legacy GeoIP.dat ..."
-       cat $DB_PATH/GeoLite2-Country-Blocks-IPv4.csv | \
-           $DB1_PATH/bin/geolite2-to-legacy-csv.sh $DB1_PATH/bin/countryInfo.txt > \
-           $TMP_FILE
-       $DB1_PATH/bin/geoip-generator -v -4 --info="$(date -u +'GEO-106FREE %Y%m%d Build -IPFire-' \
-           -r $DB_PATH/GeoLite2-Country-Blocks-IPv4.csv) $(<$DB_PATH/COPYRIGHT.txt)" -o \
-           $DB1_PATH/GeoIP.dat $TMP_FILE
-
-       return 0
-}
-
-
-function build() {
-       echo "Convert database..."
-
-       # Run script to convert the CSV file into several xtables
-       # compatible binary files.
-       if ! $SCRIPT_PATH/xt_geoip_build -S $DB_PATH -D $DEST_PATH; then
-               echo "Could not convert ruleset. Aborting." >&2
-               return 1
-       fi
-
-       return 0
-}
-
-function cleanup() {
-       echo "Cleaning up temporary files..."
-       if ! rm -rf $TMP_PATH &>/dev/null; then
-               echo "Could not remove files. Aborting." >&2
-               return 1
-       fi
-
-       return 0
-}
-
-function main() {
-       local func
-       for func in download install build build_legacy; do
-               if ! ${func}; then
-                       # Cleanup any temporary data
-                       cleanup
-
-                       return 1
-               fi
-       done
-
-       # Cleanup
-       cleanup || return $?
-
-       # All done
-       return 0
-}
-
-# Run the main function.
-main || exit $?