Tighten editing of LENGTH column(s)

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-03-07 14:07:04 -08:00
parent 05f025e422
commit c112f20e17

View File

@ -4156,8 +4156,17 @@ sub do_helper( $ ) {
sub do_length( $ ) {
my $length = $_[0];
return '' if $length eq '-';
require_capability( 'LENGTH_MATCH' , 'A Non-empty LENGTH' , 's' );
$length ne '-' ? "-m length --length $length " : '';
fatal_error "Invalid LENGTH ($length)" unless $length =~/^(\d+)(:(\d+))$/;
if ( supplied $3 ) {
fatal_error "First length must be < second length" unless $1 < $2;
}
"-m length --length $length ";
}
#