From e4256ddd9093bb0d71dc09abab4cf7b59a1ef925 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 30 Oct 2019 09:21:03 -0400 Subject: [PATCH] Can't use tainting as SOAP::WDSL::Factory::Transport will fail --- scripts/zmonvif-probe.pl.in | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/zmonvif-probe.pl.in b/scripts/zmonvif-probe.pl.in index ab06f8e0d..6b4c5c1a6 100755 --- a/scripts/zmonvif-probe.pl.in +++ b/scripts/zmonvif-probe.pl.in @@ -1,4 +1,4 @@ -#!@PERL_EXECUTABLE@ -wT +#!@PERL_EXECUTABLE@ -w use strict; # # ========================================================================== @@ -37,10 +37,9 @@ $Getopt::Std::STANDARD_HELP_VERSION = 1; our ($opt_v); -my $OPTIONS = "v"; +my $OPTIONS = 'v'; -sub HELP_MESSAGE -{ +sub HELP_MESSAGE { my ($fh, $pkg, $ver, $opts) = @_; print $fh "Usage: " . __FILE__ . " [-v] probe \n"; print $fh " " . __FILE__ . " [-v] \n"; @@ -79,9 +78,11 @@ if(!defined $action) { require ZoneMinder::ONVIF; if ( defined $opt_v ) { $ZoneMinder::ONVIF::verbose = 1; +} else { + $ZoneMinder::ONVIF::verbose = 0; } -if ( $action eq "probe" ) { +if ( $action eq 'probe' ) { my $soap_version = shift; ZoneMinder::ONVIF::discover($soap_version); } else { @@ -92,23 +93,22 @@ if ( $action eq "probe" ) { my $password = @ARGV ? shift @ARGV: ''; my $client = ONVIF::Client->new( { - 'url_svc_device' => $url_svc_device, - 'soap_version' => $soap_version } ); + url_svc_device => $url_svc_device, + soap_version => $soap_version } ); $client->set_credentials($username, $password, 1); $client->create_services(); - - if ( $action eq "profiles" ) { + if ( $action eq 'profiles' ) { ZoneMinder::ONVIF::profiles($client); - } elsif( $action eq "move" ) { + } elsif( $action eq 'move' ) { my $dir = shift; ZoneMinder::ONVIF::move($client, $dir); - } elsif ( $action eq "metadata" ) { + } elsif ( $action eq 'metadata' ) { ZoneMinder::ONVIF::metadata($client); } else { - print("Error: Unknown command\"$action\""); + print("Error: Unknown command \"$action\""); exit(1); } } @@ -152,4 +152,3 @@ zmonvif-probe.pl - ZoneMinder ONVIF probing tool -v, --version - Print the installed version of ZoneMinder =cut -