Numerous changes, documented at: https://github.com/ZoneMinder/ZoneMinder/releases Addresses two security advisories: https://github.com/ZoneMinder/ZoneMinder/releases/tag/v1.28.0 http://secunia.com/advisories/62918/ Pkgsrc changes: patch-src_zm_signal_h is no longer necessary because zm_signal.h uses HAVE_EXECINFO_H. patch-src_zmf_cpp appears to be applied upstream. patch-configure_ac no longer needs to set PATH_BUILD to PREFIX/share/zoneminder, so that zmupdate.pl can locate the database build scripts as installed files. Upstream has now implemented this via the ZM_PATH_DATA entry in zm.conf, and adds a ZM_PATH_DATA/db subdirectory. src/Makefile.am no longer setuid's zmfix, as zmfix was removed from ZoneMinder 1.26.6. The code now uses clock_gettime(), which on some systems (like Linux), calls for -lrt. Since the build system isn't aware of this, but Pkgsrc is, just set PTHREAD_AUTO_VARS=yes. The PHP code now uses PDO for DB access, but it looks like there are some straggling dependencies on the raw MySQL driver, so both are pulled in.
53 lines
2.2 KiB
Text
53 lines
2.2 KiB
Text
$NetBSD: patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm,v 1.2 2015/04/05 08:51:08 dsainty Exp $
|
|
|
|
Perl doesn't really support "> /dev/null", so just capture into $output.
|
|
|
|
% ktruss -i perl -e 'qx(does-not-exist >/dev/null 2>&1);'|egrep 'dup2.*2'
|
|
does-not-exist: not found
|
|
% ktruss -i perl -e 'qx(does-not-exist 2>&1);'|egrep 'dup2.*2'
|
|
16954 1 perl dup2(0x1, 0x2) = 2
|
|
|
|
The problem is that, whilst Perl supports 2>&1 internally (and does not use
|
|
the shell at all) if there is no other redirection, it does not support file
|
|
redirection - it defers that (and therefore necessarily must also defer the
|
|
stderr redirection) to the shell. If the system's shell happens to report
|
|
"Not found" errors before redirection is processed (E.g. NetBSD shell) then
|
|
the stderr redirection is happening too late to be captured.
|
|
|
|
That leads to unintended errors reported on stderr - primarily if sudo is not
|
|
installed on the system, or not in the $PATH.
|
|
|
|
Use the -m parameter to su, as ZM_WEB_USER shouldn't require a login shell.
|
|
|
|
--- scripts/ZoneMinder/lib/ZoneMinder/General.pm.orig 2015-04-01 19:40:39.708621257 +1300
|
|
+++ scripts/ZoneMinder/lib/ZoneMinder/General.pm 2015-04-01 19:50:47.372646449 +1300
|
|
@@ -107,7 +107,7 @@
|
|
my $suffix = "";
|
|
my $command = $prefix.$null_command.$suffix;
|
|
Debug( "Testing \"$command\"\n" );
|
|
- $command .= " > /dev/null 2>&1";
|
|
+ $command .= " 2>&1";
|
|
my $output = qx($command);
|
|
my $status = $? >> 8;
|
|
if ( !$status )
|
|
@@ -124,6 +124,7 @@
|
|
$suffix = "'";
|
|
$command = $prefix.$null_command.$suffix;
|
|
Debug( "Testing \"$command\"\n" );
|
|
+ $command .= " 2>&1";
|
|
my $output = qx($command);
|
|
my $status = $? >> 8;
|
|
if ( !$status )
|
|
@@ -136,10 +137,11 @@
|
|
chomp( $output );
|
|
Debug( "Test failed, '$output'\n" );
|
|
|
|
- $prefix = "su ".$Config{ZM_WEB_USER}." -c '";
|
|
+ $prefix = "su -m ".$Config{ZM_WEB_USER}." -c '";
|
|
$suffix = "'";
|
|
$command = $prefix.$null_command.$suffix;
|
|
Debug( "Testing \"$command\"\n" );
|
|
+ $command .= " 2>&1";
|
|
$output = qx($command);
|
|
$status = $? >> 8;
|
|
if ( !$status )
|