Merge pull request #264 from ZoneMinder/improvezmpkg
Use proper DBI parameter passing in zmpkg.pl to improve securitypull/269/head
commit
c3c3cfbfb9
|
@ -57,9 +57,9 @@ if ( !$command || $command !~ /^(?:start|stop|restart|status|logrot)$/ )
|
|||
if ( $command )
|
||||
{
|
||||
# Check to see if it's a valid run state
|
||||
my $sql = "select * from States where Name = '$command'";
|
||||
my $sql = 'select * from States where Name = ?';
|
||||
my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() );
|
||||
my $res = $sth->execute( $command ) or Fatal( "Can't execute: ".$sth->errstr() );
|
||||
if ( $state = $sth->fetchrow_hashref() )
|
||||
{
|
||||
$state->{Name} = $command;
|
||||
|
@ -138,7 +138,7 @@ if ( $command =~ /^(?:stop|restart)$/ )
|
|||
}
|
||||
}
|
||||
|
||||
runCommand( "zmupdate.pl -f" );
|
||||
#runCommand( "zmupdate.pl -f" );
|
||||
|
||||
if ( $command =~ /^(?:start|restart)$/ )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue