Don't allow shell meta characters in interface names

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-10-11 17:01:45 -07:00
parent d5aaa66e0b
commit b80d4c2320
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -1119,7 +1119,7 @@ sub process_interface( $$ ) {
my ($interface, $port, $extra) = split /:/ , $originalinterface, 3;
fatal_error "Invalid interface name ($interface)" if $interface =~ /[()\[\]]\*\?/;
fatal_error "Invalid interface name ($interface)" if $interface =~ /[()\[\]\*\?%]/;
fatal_error "Invalid INTERFACE ($originalinterface)" if ! $interface || defined $extra;
@ -1318,7 +1318,7 @@ sub process_interface( $$ ) {
fatal_error "The '$option' option requires a value" unless defined $value;
if ( $option eq 'physical' ) {
fatal_error "Invalid physical interface name ($interface)" if $interface =~ /[()\[\]]\*\?%/;
fatal_error "Invalid interface name ($interface)" if $interface =~ /[()\[\]\*\?%]/;
fatal_error "Virtual interfaces ($value) are not supported" if $value =~ /:\d+$/;
fatal_error "Duplicate physical interface name ($value)" if ( $interfaces{$value} && ! $port );