Can't use tainting as SOAP::WDSL::Factory::Transport will fail

This commit is contained in:
Isaac Connor 2019-10-30 09:21:03 -04:00
parent 1e6abd7bbc
commit e4256ddd90
1 changed files with 12 additions and 13 deletions

View File

@ -1,4 +1,4 @@
#!@PERL_EXECUTABLE@ -wT #!@PERL_EXECUTABLE@ -w
use strict; use strict;
# #
# ========================================================================== # ==========================================================================
@ -37,10 +37,9 @@ $Getopt::Std::STANDARD_HELP_VERSION = 1;
our ($opt_v); our ($opt_v);
my $OPTIONS = "v"; my $OPTIONS = 'v';
sub HELP_MESSAGE sub HELP_MESSAGE {
{
my ($fh, $pkg, $ver, $opts) = @_; my ($fh, $pkg, $ver, $opts) = @_;
print $fh "Usage: " . __FILE__ . " [-v] probe <soap version>\n"; print $fh "Usage: " . __FILE__ . " [-v] probe <soap version>\n";
print $fh " " . __FILE__ . " [-v] <command> <device URI> <soap version> <user> <password>\n"; print $fh " " . __FILE__ . " [-v] <command> <device URI> <soap version> <user> <password>\n";
@ -79,9 +78,11 @@ if(!defined $action) {
require ZoneMinder::ONVIF; require ZoneMinder::ONVIF;
if ( defined $opt_v ) { if ( defined $opt_v ) {
$ZoneMinder::ONVIF::verbose = 1; $ZoneMinder::ONVIF::verbose = 1;
} else {
$ZoneMinder::ONVIF::verbose = 0;
} }
if ( $action eq "probe" ) { if ( $action eq 'probe' ) {
my $soap_version = shift; my $soap_version = shift;
ZoneMinder::ONVIF::discover($soap_version); ZoneMinder::ONVIF::discover($soap_version);
} else { } else {
@ -92,23 +93,22 @@ if ( $action eq "probe" ) {
my $password = @ARGV ? shift @ARGV: ''; my $password = @ARGV ? shift @ARGV: '';
my $client = ONVIF::Client->new( { my $client = ONVIF::Client->new( {
'url_svc_device' => $url_svc_device, url_svc_device => $url_svc_device,
'soap_version' => $soap_version } ); soap_version => $soap_version } );
$client->set_credentials($username, $password, 1); $client->set_credentials($username, $password, 1);
$client->create_services(); $client->create_services();
if ( $action eq 'profiles' ) {
if ( $action eq "profiles" ) {
ZoneMinder::ONVIF::profiles($client); ZoneMinder::ONVIF::profiles($client);
} elsif( $action eq "move" ) { } elsif( $action eq 'move' ) {
my $dir = shift; my $dir = shift;
ZoneMinder::ONVIF::move($client, $dir); ZoneMinder::ONVIF::move($client, $dir);
} elsif ( $action eq "metadata" ) { } elsif ( $action eq 'metadata' ) {
ZoneMinder::ONVIF::metadata($client); ZoneMinder::ONVIF::metadata($client);
} else { } else {
print("Error: Unknown command\"$action\""); print("Error: Unknown command \"$action\"");
exit(1); exit(1);
} }
} }
@ -152,4 +152,3 @@ zmonvif-probe.pl - ZoneMinder ONVIF probing tool
-v, --version - Print the installed version of ZoneMinder -v, --version - Print the installed version of ZoneMinder
=cut =cut