Bug #10332
closedPFBlockerNG loading GeoLite2-Country.mmdb
0%
Description
Running pfsense 2.4.5.r.20200305.1800 with pfBlockerNG-devel 2.2.5_29
After downloading GeoLite2-Country.tar.gz, pfb extracts the mime type from the download using the "file" command.
The file command returns "application/gzip" for GeoLite2-Country.tar.gz
PFB then uses the mime type to determine how to handle the download. The default is to rename the download to the target name.
The application/gzip type is not one of the handled types, so GeoLite2-Country.tar.gz is renamed to GeoLite2-Country.mmdb
When mmdblookup tries to lookup the country info from filter logs during report generation, it receives the error:
Can't open /usr/local/share/GeoIP/GeoLite2-Country.mmdb - The MaxMind DB file contains invalid metadata
The GeoIP info in pfb reports is then listed and "Unk"
In the pfb_download function, changing :
if ($file_type 'application/x-gzip') {
to:
if ($file_type 'application/x-gzip' || $file_type == 'application/gzip') {
appears to solve the problem.