mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 08:44:05 +01:00
Tighten the rule compatibility test in sub compatible().
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
3c98094242
commit
ccdda4c73b
@ -819,10 +819,17 @@ sub compatible( $$ ) {
|
||||
for ( @unique_options ) {
|
||||
if ( defined( $val1 = $ref1->{$_} ) && defined( $val2 = $ref2->{$_} ) ) {
|
||||
unless ( $val1 eq $val2 ) {
|
||||
#
|
||||
# Values are different -- be sure that $val1 is a leading subset of $val2;
|
||||
#
|
||||
my @val1 = split ' ', $val1;
|
||||
my @val2 = split ' ', $val2;
|
||||
|
||||
return 0 if @val1 > @val2; # $val1 is more specific than $val2
|
||||
|
||||
return 0 if @val1 > @val2 || $val1[0] ne $val2[0];
|
||||
for ( my $i = 0; $i < @val1; $i++ ) {
|
||||
return 0 unless $val1[$i] eq $val2[$i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user