Another error check for hosts files and loopback zones.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-05-28 10:00:07 -07:00
parent 446f764d19
commit eaf1d0e5c2

View File

@ -1899,7 +1899,11 @@ sub process_host( ) {
$hosts = $2;
fatal_error "Unknown interface ($interface)" unless ($interfaceref = $interfaces{$interface}) && $interfaceref->{root};
fatal_error "Loopback zones may only be associated with the loopback interface (lo)" if $type == LOOPBACK && $interfaceref->{name} ne 'lo';
if ( $interfaceref->{name} eq 'lo' ) {
fatal_error "Only a loopback zone may be associated with the loopback interface (lo)" if $type != LOOPBACK;
} else {
fatal_error "Loopback zones may only be associated with the loopback interface (lo)" if $type == LOOPBACK;
}
} else {
fatal_error "Invalid HOST(S) column contents: $hosts"
}