[Mon-commit] mon mon,1.4.2.14,1.4.2.15
Brought to you by:
trockij
From: Jim T. <tr...@us...> - 2005-01-18 20:45:09
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4533 Modified Files: Tag: mon-1-0-0pre1 mon Log Message: fixed auth.cf trap section parsing, prob reported by jgarzik Index: mon =================================================================== RCS file: /cvsroot/mon/mon/mon,v retrieving revision 1.4.2.14 retrieving revision 1.4.2.15 diff -C2 -d -r1.4.2.14 -r1.4.2.15 *** mon 19 Nov 2004 18:27:47 -0000 1.4.2.14 --- mon 18 Jan 2005 20:44:45 -0000 1.4.2.15 *************** *** 2608,2613 **** # } elsif ($cmd eq "checkauth") { ! split(' ',$args); ! $cmd = $_[0]; $user = $clients{$cl}->{"user"}; # Note that we call check_auth without syslogging here. --- 2608,2612 ---- # } elsif ($cmd eq "checkauth") { ! $cmd = (split(' ', $args))[0]; $user = $clients{$cl}->{"user"}; # Note that we call check_auth without syslogging here. *************** *** 3621,3624 **** --- 3620,3624 ---- } ($host, $user, $password) = ($1, $2, $3); + my $host_orig = $host; if ($host eq "*") { *************** *** 3627,3639 **** # ! } 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; } else { ! syslog ('err', "invalid host in $CF{AUTHFILE}, line $."); next; } --- 3627,3646 ---- # ! } elsif ($host =~ /^[a-z]/) { ! ! if (($host = gethostbyname ($host)) eq "") { ! syslog ('err', "invalid host in $CF{AUTHFILE} (could not resolve IP address for $host_orig), 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} (bad IP address, $host_orig), line $."); ! next; ! } ! } else { ! syslog ('err', "invalid host in $CF{AUTHFILE} (cannot determine address, $host_orig), line $."); next; } *************** *** 3777,3781 **** my $trap_val = $2; chomp $trap_val; ! $trap_val =~ s/^\'(.*)\'$/\1/; $trap{$trap_name} = un_esc_str ($trap_val); } --- 3784,3788 ---- my $trap_val = $2; chomp $trap_val; ! $trap_val =~ s/^\'(.*)\'$/$1/; $trap{$trap_name} = un_esc_str ($trap_val); } |