diff options
author | dsainty <dsainty@pkgsrc.org> | 2014-05-20 11:30:27 +0000 |
---|---|---|
committer | dsainty <dsainty@pkgsrc.org> | 2014-05-20 11:30:27 +0000 |
commit | 7b6678106cf65a9f3f4f30c3a7db750aa41cff46 (patch) | |
tree | 16afc2bf9a7a28c4fa5eb80f0ada00a1db2d94fb /security | |
parent | d9e44cbdd9ead13386492b0d7749f63df5504db0 (diff) | |
download | pkgsrc-7b6678106cf65a9f3f4f30c3a7db750aa41cff46.tar.gz |
Improve behaviour under NetBSD, successfully supressing error messages under
NetBSD's shell, and passing the -m option to NetBSD's "su" command to support
users without login shells.
Add the PREFIX to all script PATHs. This can allow sudo to be installed and
used as an alternative to su, should there be any value in doing that.
Bump PKGREVISION.
Diffstat (limited to 'security')
-rw-r--r-- | security/zoneminder/Makefile | 13 | ||||
-rw-r--r-- | security/zoneminder/distinfo | 3 | ||||
-rw-r--r-- | security/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm | 53 |
3 files changed, 63 insertions, 6 deletions
diff --git a/security/zoneminder/Makefile b/security/zoneminder/Makefile index 14176885806..800d62f777d 100644 --- a/security/zoneminder/Makefile +++ b/security/zoneminder/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.9 2014/05/06 15:07:40 jperkin Exp $ +# $NetBSD: Makefile,v 1.10 2014/05/20 11:30:27 dsainty Exp $ # DISTNAME= ZoneMinder-1.25.0 PKGNAME= ${DISTNAME:S/ZoneMinder-/zoneminder-/} -PKGREVISION= 5 +PKGREVISION= 6 CATEGORIES= security MASTER_SITES= http://www2.zoneminder.com/downloads/ @@ -131,12 +131,15 @@ SUBST_SED.dbpaths-path= -e 's|/usr/local/bin/|${PREFIX}/bin/|g' SUBST_SED.dbpaths-path+= -e 's|/usr/bin|${PREFIX}/bin|g' SUBST_SED.dbpaths-path+= -e 's|/cgi-bin/nph-zms|/zm/cgi-bin/nph-zms|g' -# Required to find the 'mysql' client executable. +# +# Required to find the 'mysql' client executable, and may also use 'sudo' if +# installed. +# SUBST_CLASSES+= script-path SUBST_MESSAGE.script-path= Adjusting paths in scripts. SUBST_STAGE.script-path= pre-configure -SUBST_FILES.script-path= scripts/zmupdate.pl.in -SUBST_SED.script-path= -e 's|/usr/local/bin|${PREFIX}/bin|g' +SUBST_FILES.script-path= ${REPLACE_PERL} +SUBST_SED.script-path= -e "s|^\\([\$$]ENV{PATH} *= *'\\).*';\$$|\\1${PREFIX}/bin:/bin:/usr/bin';|g" SUBST_CLASSES+= files SUBST_STAGE.files= pre-configure diff --git a/security/zoneminder/distinfo b/security/zoneminder/distinfo index 8b8f31961f1..3cfea4befdf 100644 --- a/security/zoneminder/distinfo +++ b/security/zoneminder/distinfo @@ -1,10 +1,11 @@ -$NetBSD: distinfo,v 1.3 2013/04/29 21:31:12 joerg Exp $ +$NetBSD: distinfo,v 1.4 2014/05/20 11:30:27 dsainty Exp $ SHA1 (ZoneMinder-1.25.0.tar.gz) = a93a976a5cd82f1e197f4d7bd626d3f0387c4231 RMD160 (ZoneMinder-1.25.0.tar.gz) = 32a4f503770103e55bfe592864c1cab82e7395a6 Size (ZoneMinder-1.25.0.tar.gz) = 1119091 bytes SHA1 (patch-Makefile_am) = 09b3ba7f9c292ef672506219be66f059290b6405 SHA1 (patch-configure_ac) = 87410ce8bc8fe42e08bf0e32e40b59619f7db90d +SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm) = 9aa69b922c323e2ba34e37de7923e2ee97430f7f SHA1 (patch-scripts_zm_in) = 91809c9a179a0135c432a0ffad7c2d2ddfd512de SHA1 (patch-src_Makefile_am) = 84999df8b7c80b049e2dd9cb308e12f50ed8285f SHA1 (patch-src_zm__thread.h) = 8313d3294592fd08c775f612d70cc935e4f64d9a diff --git a/security/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm b/security/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm new file mode 100644 index 00000000000..1f6021035fa --- /dev/null +++ b/security/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm @@ -0,0 +1,53 @@ +$NetBSD: patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm,v 1.1 2014/05/20 11:30:27 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 2014-05-13 22:59:22.229694642 +1200 ++++ scripts/ZoneMinder/lib/ZoneMinder/General.pm 2014-05-13 23:03:06.377703932 +1200 +@@ -103,7 +103,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 ) +@@ -120,6 +120,7 @@ + $suffix = "'"; + $command = $prefix.$null_command.$suffix; + Debug( "Testing \"$command\"\n" ); ++ $command .= " 2>&1"; + my $output = qx($command); + my $status = $? >> 8; + if ( !$status ) +@@ -132,10 +133,11 @@ + chomp( $output ); + Debug( "Test failed, '$output'\n" ); + +- $prefix = "su ".ZM_WEB_USER." -c '"; ++ $prefix = "su -m ".ZM_WEB_USER." -c '"; + $suffix = "'"; + $command = $prefix.$null_command.$suffix; + Debug( "Testing \"$command\"\n" ); ++ $command .= " 2>&1"; + $output = qx($command); + $status = $? >> 8; + if ( !$status ) |