Correct helper validation

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-12-30 13:20:56 -08:00
parent 769125903d
commit 5848d7cab7

View File

@ -4467,14 +4467,14 @@ sub validate_helper( $;$ ) {
# #
# Recognized helper # Recognized helper
# #
my $capability = $helpers_map{$helper}; my $capability = $helpers_map{defined $proto ? $helper : $helper_base};
my $external_helper = lc $capability; my $external_helper = lc $capability;
$external_helper =~ s/_helper//; $external_helper =~ s/_helper//;
$external_helper =~ s/_/-/; $external_helper =~ s/_/-/;
fatal_error "The $external_helper helper is not enabled" unless $helpers_enabled{$external_helper}; fatal_error "The $external_helper helper is not enabled" unless $helpers_enabled{$external_helper};
if ( supplied $proto ) { if ( supplied $proto ) {
require_capability $helpers_map{$helper}, "Helper $helper", 's'; require_capability $helpers_map{$helper}, "Helper $helper", 's';
@ -4501,7 +4501,10 @@ sub do_helper( $ ) {
validate_helper( $helper ); validate_helper( $helper );
qq(-m helper --helper "$helpers_aliases{$helper}" ) if defined wantarray; if ( defiend wantarray ) {
$helper = $helpers_aliases{$helper} || $helper;
qq(-m helper --helper $helper );
}
} }