From:
[email protected]
On Thu, 27 May 2004 17:56:20 +0200, Lars Bahner <
[email protected]> said:
On starting mon, mon keeps coraking about "invalid host" in auth.cf.
The parsing for host-based trap entries was completely broken. I fixed
it by back-porting the parsing code from the current version. I'll be
uploaded in the next version.
--- mon.~1~ 2001-09-13 20:20:30.000000000 -0400
+++ mon 2004-08-20 14:40:41.000000000 -0400
@@ -3504,13 +3504,16 @@
# allow traps from all hosts
#
- } elsif ($host =~ /^[a-z]/ && ($host = gethostbyname ($host)) eq "") {
- syslog ('err', "invalid host in $CF{AUTHFILE}, line $.");
- next;
- } elsif ($host =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ &&
- ($host = inet_aton ($host)) eq "") {
- syslog ('err', "invalid host in $CF{AUTHFILE}, line $.");
- next;
+ } elsif ($host =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) {
+ if (($host = inet_aton ($host)) eq "") {
+ syslog ('err', "invalid host in $CF{AUTHFILE}, line $.");
+ next;
+ }
+ } elsif ($host =~ /^[A-Z\d][[A-Z\.\d\-]*[[A-Z\d]+$/i) {
+ if (($host = inet_aton ($host)) eq "") {
+ syslog ('err', "invalid host in $CF{AUTHFILE}, line $.");
+ next;
+ }
} else {
syslog ('err', "invalid host in $CF{AUTHFILE}, line $.");
next;
--
Rode