diff options
-rwxr-xr-x | lib/Vyatta/TypeChecker.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Vyatta/TypeChecker.pm b/lib/Vyatta/TypeChecker.pm index b249613..e436e0c 100755 --- a/lib/Vyatta/TypeChecker.pm +++ b/lib/Vyatta/TypeChecker.pm @@ -68,6 +68,7 @@ my %type_handler = ( 'hex16' => \&validate_hex_16_bits, 'hex32' => \&validate_hex_32_bits, 'ipv6_addr_param' => \&validate_ipv6_addr_param, + 'restrictive_filename' => \&validate_restrictive_filename ); sub validate_ipv4 { @@ -267,6 +268,12 @@ sub validate_ipv6_addr_param { } } +# validate a restrictive filename +sub validate_restrictive_filename { + my $value = shift; + return (($value =~ /^[-_.a-zA-Z0-9]+$/) ? 1 : 0); +} + sub validateType { my ($type, $value, $quiet) = @_; if (!defined($type) || !defined($value)) { |