eldy / AWStats

AWStats Log Analyzer project (official sources)
https://www.awstats.org
369 stars 120 forks source link

Add a few more protections if current name doesn't resolve anymore. #115

Closed neilgierman closed 5 years ago

neilgierman commented 5 years ago

Looking at previous reports, if a name was no longer resolving either because the DNS entry was no longer there, or a temporary failure in DNS resolution, the current code would fail at the $address = inet_ntoa(inet_aton($param)); line. Added some logic that if the inet_aton returned nothing, then skip this entry and keep going.

Rehtael commented 5 years ago

Line 124 has this original problem....especially if $param happens to be empty

neilgierman commented 5 years ago

Yes, but on Line 120, if $param is empty it immediately returns.

Rehtael commented 5 years ago

`Create/Update database for config "/etc/awstats/awstats.site.conf" by AWStats version 7.7 (build 20180105)

From data in log file "/usr/local/awstats/tools/logresolvemerge.pl /var/log/apache2/log1.log /var/log/apache2/log2.log |"...

Bad arg length for Socket::inet_ntoa, length is 0, should be 4 at /usr/local/awstats/wwwroot/cgi-bin/plugins/geoip2.pm line 124, line 13483.

Phase 1 : First bypass old records, searching new record...

Searching new records from beginning of log file...

Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...`

eldy commented 5 years ago

Hope to have this fixed by #131