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.
Updated by Marcos M about 4 years ago
I could not reproduce this on pfSense 2.4.5-p1 running pfBlockerNG-devel 2.2.5_36.
Looking under /usr/local/share/GeoIP/ I can see GeoLite2-Country.mmdb is extracted correctly from GeoLite2-Country.tar.gz.
Updated by John Clark about 4 years ago
It appears that this was fixed.
https://github.com/pfsense/FreeBSD-ports/commit/2eae4ebc337619fb4f6f32979968394649c2d929