-Have makedns be more tolerant of different whitespace delimiters

-Warn on invalid IPv4 addresses (think this may have caused tracker issue 1912698)


git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@859 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-03-20 18:56:14 +00:00
parent d9d048d61d
commit 7b4cee2d25

View File

@ -114,11 +114,17 @@ LINE: while(<HOSTS>){
tr/A-Z/a-z/; # translate to lower case
($data,$comment) = split('#', $_, 2);
($addr, $names) = split(' ', $data, 2);
($addr, $names) = split(/[ ]+/, $data, 2);
if ($names =~ /^[ \t]*$/) {
#$callback->({data=>["Bad line in hosts file ignored '$_'"]});
next LINE;
}
$addr =~ s/^[ ]*//;
$addr =~ s/[ ]*$//;
if ($addr !~ /^\d+\.\d+\.\d+\.\d+$/) {
$callback->({data=>["Ignoring $addr (not a valid IPv4 address)"]});
next LINE;
}
# Match -e args
foreach $netpat (@elimpats){