-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:
		@@ -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){
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user