From 2ca2b07a5ec0d675483db998756848249a76438c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 5 Feb 2016 13:14:04 -0500 Subject: [PATCH] detaint calls for concurrent zmfilter.pl --- scripts/zmfilter.pl.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in index 86593ee9e..a585f8610 100755 --- a/scripts/zmfilter.pl.in +++ b/scripts/zmfilter.pl.in @@ -27,7 +27,7 @@ zmfilter.pl - ZoneMinder tool to filter events =head1 SYNOPSIS - zmfilter.pl [-f ,--filter=] [-fid ,--filter_id=] | -v, --version + zmfilter.pl [-f ,--filter=] [--filter_id=] | -v, --version =head1 DESCRIPTION @@ -39,7 +39,7 @@ matching events. -f{filter name}, --filter={filter name} - The name of a specific filter to run - -fid {filter id}, --filter_id={filter id}- The id of a specific filter to run + --filter_id={filter id} - The id of a specific filter to run -v, --version - Print ZoneMinder version =cut @@ -76,7 +76,7 @@ my $version = 0; GetOptions( 'filter=s' =>\$filter_name, - 'filter_id=s' =>\$filter_id, + 'filter_id=s' =>\$filter_id, 'version' =>\$version ) or pod2usage(-exitstatus => -1); @@ -188,8 +188,11 @@ while( 1 ) { foreach my $filter ( @$filters ) { if ( $$filter{Concurrent} and ! $filter_id ) { - Debug("Running concurrent filter process for $$filter{Name}"); - `$0 -fid $$filter{Id}`; + my ( $proc ) = $0 =~ /(\S+)/; + my ( $id ) = $$filter{Id} =~ /(\d+)/; + + Debug("Running concurrent filter process ($proc) for $id $$filter{Name}"); + `$proc -filter_id $id`; } else { checkFilter( $filter ); }