From 176220f1bf8005a912eed03b8fbdd35a0efc42a0 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 8 Apr 2016 07:44:30 -0500 Subject: [PATCH 01/10] Update version Bumping back to 1.29.0 Note to all: We need to remember to bump this at the moment we create our next release --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 83cf0d951..5e57fb895 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.29.1 +1.29.0 From dafdf1a28913b0d7997cb9a1c9c25f4ebfbf05a0 Mon Sep 17 00:00:00 2001 From: Andy Bauer Date: Fri, 8 Apr 2016 19:22:27 -0500 Subject: [PATCH 02/10] rpm specfile changes --- distros/fedora/zonemidner.f22.spec | 1 - distros/fedora/zoneminder.f22.spec | 409 +---------------------------- distros/fedora/zoneminder.f23.spec | 1 + distros/redhat/zoneminder.el6.spec | 1 + distros/redhat/zoneminder.el7.spec | 1 + 5 files changed, 4 insertions(+), 409 deletions(-) delete mode 120000 distros/fedora/zonemidner.f22.spec mode change 100644 => 120000 distros/fedora/zoneminder.f22.spec diff --git a/distros/fedora/zonemidner.f22.spec b/distros/fedora/zonemidner.f22.spec deleted file mode 120000 index 808e7cb9f..000000000 --- a/distros/fedora/zonemidner.f22.spec +++ /dev/null @@ -1 +0,0 @@ -zoneminder.f23.spec \ No newline at end of file diff --git a/distros/fedora/zoneminder.f22.spec b/distros/fedora/zoneminder.f22.spec deleted file mode 100644 index 40343090f..000000000 --- a/distros/fedora/zoneminder.f22.spec +++ /dev/null @@ -1,408 +0,0 @@ -%define zmuid $(id -un) -%define zmgid $(id -gn) -%define zmuid_final apache -%define zmgid_final apache - -%global _hardened_build 1 - -### Delete the lines below to build with ffmpeg and/or x10 -%define _without_ffmpeg 1 -%define _without_x10 1 - -Name: zoneminder -Version: 1.29.0 -Release: 1%{?dist} -Summary: A camera monitoring and analysis tool -Group: System Environment/Daemons -# jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/ -# Mootools is inder the MIT license: http://mootools.net/ -License: GPLv2+ and LGPLv2+ and MIT -URL: http://www.zoneminder.com/ - -#Source: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz -Source: ZoneMinder-%{version}.tar.gz - -BuildRequires: cmake gnutls-devel systemd-units bzip2-devel -BuildRequires: mariadb-devel pcre-devel libjpeg-turbo-devel -BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators -BuildRequires: perl(Date::Manip) perl(DBD::mysql) -BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent) -BuildRequires: perl(MIME::Entity) perl(MIME::Lite) -BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap) -BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign) -BuildRequires: perl(Expect) perl(Sys::Syslog) -BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel -%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel} -%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)} -# cmake needs the following installed at build time due to the way it auto-detects certain parameters -BuildRequires: httpd polkit-devel -%{!?_without_ffmpeg:BuildRequires: ffmpeg} - -Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc -Requires: libjpeg-turbo vlc-core libcurl -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip) -Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP) -Requires: perl(LWP::Protocol::https) -%{!?_without_ffmpeg:Requires: ffmpeg} - -Requires(post): systemd-units systemd-sysv -Requires(post): /usr/bin/gpasswd -Requires(post): /usr/bin/less -Requires(preun): systemd-units -Requires(postun): systemd-units - -%description -ZoneMinder is a set of applications which is intended to provide a complete -solution allowing you to capture, analyse, record and monitor any cameras you -have attached to a Linux based machine. It is designed to run on kernels which -support the Video For Linux (V4L) interface and has been tested with cameras -attached to BTTV cards, various USB cameras and IP network cameras. It is -designed to support as many cameras as you can attach to your computer without -too much degradation of performance. - -%prep -%setup -q -n ZoneMinder-%{version} - -# Change the following default values -./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin-zm/nph-zms -./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes -./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm -./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload -./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes -./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no -./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no - -%build -%cmake \ - -DZM_TARGET_DISTRO="f22" \ -%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \ -%{?_without_x10:-DZM_NO_X10=ON} \ - . - -make %{?_smp_mflags} - -%install -export DESTDIR=%{buildroot} -make install - -%post -if [ $1 -eq 1 ] ; then - # Initial installation - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi - -# Allow zoneminder access to local video sources, serial ports, and x10 -/usr/bin/gpasswd -a %{zmuid_final} video -/usr/bin/gpasswd -a %{zmuid_final} dialout - -# Upgrade from a previous version of zoneminder -if [ $1 -eq 2 ] ; then - # Freshen the database - /usr/bin/zmupdate.pl -f - - # We can't run this automatically when new sql account permissions need to - # be manually added first - # Run zmupdate non-interactively - #/usr/bin/zmupdate.pl --nointeractive -fi - -# Warn the end user to read the README file -echo -e "\nVERY IMPORTANT: Before starting ZoneMinder, read README.Fedora to finish the\ninstallation or upgrade!\n" -echo -e "\nThe README file is located here: %{_docdir}/%{name}\n" - -%preun -if [ $1 -eq 0 ] ; then - # Package removal, not upgrade - /bin/systemctl --no-reload disable zoneminder.service > /dev/null 2>&1 || : - /bin/systemctl stop zoneminder.service > /dev/null 2>&1 || : -fi - -%postun -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then - # Package upgrade, not uninstall - /bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || : -fi - -%triggerun -- zoneminder < 1.25.0-4 -# Save the current service runlevel info -# User must manually run systemd-sysv-convert --apply zoneminder -# to migrate them to systemd targets -/usr/bin/systemd-sysv-convert --save zoneminder >/dev/null 2>&1 ||: - -# Run these because the SysV package being removed won't do them -/sbin/chkconfig --del zoneminder >/dev/null 2>&1 || : -/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || : - - -%files -%defattr(-,root,root,-) -%doc AUTHORS COPYING README.md distros/fedora/README.Fedora distros/fedora/README.https distros/fedora/jscalendar-doc -%config %attr(640,root,%{zmgid_final}) /etc/zm/zm.conf -%config(noreplace) %attr(644,root,root) /etc/httpd/conf.d/zoneminder.conf -%config(noreplace) /etc/tmpfiles.d/zoneminder.conf -%config(noreplace) /etc/logrotate.d/zoneminder - -%{_unitdir}/zoneminder.service - -%{_bindir}/zma -%{_bindir}/zmaudit.pl -%{_bindir}/zmc -%{_bindir}/zmcontrol.pl -%{_bindir}/zmdc.pl -%{_bindir}/zmf -%{_bindir}/zmfilter.pl -%{_bindir}/zmpkg.pl -%{_bindir}/zmtrack.pl -%{_bindir}/zmtrigger.pl -%{_bindir}/zmu -%{_bindir}/zmupdate.pl -%{_bindir}/zmvideo.pl -%{_bindir}/zmwatch.pl -%{_bindir}/zmcamtool.pl -%{_bindir}/zmsystemctl.pl -%{!?_without_x10:%{_bindir}/zmx10.pl} - -%{perl_vendorlib}/ZoneMinder* -%{_mandir}/man*/* -%dir %{_libexecdir}/zoneminder -%{_libexecdir}/zoneminder/cgi-bin -%dir %{_datadir}/zoneminder -%{_datadir}/zoneminder/db -%{_datadir}/zoneminder/www - -%{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy -%{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules - -%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder -%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/events -%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/images -%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/sock -%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/swap -%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/temp -%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/log/zoneminder -%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/spool/zoneminder-upload -%dir %attr(755,%{zmuid_final},%{zmgid_final}) /run/zoneminder - - -%changelog -* Sat Feb 14 2015 Andrew Bauer - 1.28.1 -- Bump version for 1.28.1 release on Fedora 21. - -* Sun Oct 5 2014 Andrew Bauer - 1.28.0 -- Bump version for 1.28.0 release. - -* Fri Mar 14 2014 Andrew Bauer - 1.27 -- Tweak build requirements for cmake - -* Sat Feb 01 2014 Andrew Bauer - 1.27 -- Add zmcamtool.pl. Bump version for 1.27 release. - -* Mon Dec 16 2013 Andrew Bauer - 1.26.5 -- This is a bug fixe release -- RTSP fixes, cmake enhancements, couple other misc fixes - -* Mon Oct 07 2013 Andrew Bauer - 1.26.4 -- Initial cmake build. - -* Sat Oct 05 2013 Andrew Bauer - 1.26.4 -- Fedora specific path changes have been moved to zoneminder-1.26.0-defaults.patch -- All files are now part of the zoneminder source tree. Update specfile accordingly. - -* Sat Sep 21 2013 Andrew Bauer - 1.26.3 -- Initial rebuild for ZoneMinder 1.26.3 release. - -* Fri Feb 15 2013 Fedora Release Engineering - 1.25.0-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Mon Jan 21 2013 Adam Tkac - 1.25.0-12 -- rebuild due to "jpeg8-ABI" feature drop - -* Mon Jan 7 2013 Remi Collet - 1.25.0-11 -- fix configuration file for httpd 2.4, #871502 - -* Fri Dec 21 2012 Adam Tkac - 1.25.0-10 -- rebuild against new libjpeg - -* Thu Aug 09 2012 Jason L Tibbitts III - 1.25.0-9 -- Add patch to work around v4l2 api breakage in 3.5 kernel. - -* Sun Jul 22 2012 Fedora Release Engineering - 1.25.0-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Sat Jun 23 2012 Petr Pisar - 1.25.0-7 -- Perl 5.16 rebuild - -* Wed Mar 21 2012 Jason L Tibbitts III - 1.25.0-6 -- Fix stupid thinko in sql modifications. - -* Sat Feb 25 2012 Jason L Tibbitts III - 1.25.0-5 -- Clean up macro usage. - -* Sat Feb 25 2012 Jason L Tibbitts III - 1.25.0-4 -- Convert to systemd. -- Add tmpfiles.d configuration since the initscript isn't around to create - /run/zoneminder. -- Remove some pointless executable permissions. -- Add logrotate file. - -* Wed Feb 22 2012 Jason L Tibbitts III - 1.25.0-3 -- Update README.Fedora to reference systemctl and mention timezone info in - php.ini. -- Add proper default for EYEZM_LOG_TO_FILE. - - -* Thu Feb 09 2012 Jason L Tibbitts III - 1.25.0-2 -- Rebuild for new pcre. - -* Thu Jan 19 2012 Jason L Tibbitts III - 1.25.0-1 -- Update to 1.25.0 -- Fix gcc4.7 build problems. -- Drop gcc4.4 build fixes; for whatever reason they now break the build. -- Clean up old patches. -- Force setting of ZM_TMPDIR and ZM_RUNDIR. - -* Sat Jan 14 2012 Fedora Release Engineering - 1.24.4-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Thu Sep 15 2011 Jason L Tibbitts III - 1.24.4-3 -- Re-add the dist-tag that somehow got lost. - -* Thu Sep 15 2011 Jason L Tibbitts III - 1.24.4-2 -- Add patch for bug 711780 - fix syntax issue in Mapped.pm. -- Undo that patch, and undo another which was the cause of the whole mess. -- Fix up other patches so ZM_PATH_BUILD is both defined and useful. -- Make sure database creation mods actually take. -- Update Fedora-specific docs with some additional info. -- Use bundled mootools (javascript, so no guideline violation). -- Update download location. -- Update the gcrypt patch to actually work. -- Upstream changed the tarball without changing the version to patch a - vulnerability, so redownload. - -* Sun Aug 14 2011 Jason L Tibbitts III - 1.24.4-1 -- Initial attempt to upgrade to 1.24.4. -- Add patch from BZ 460310 to build against libgcrypt instead of requiring the - gnutls openssl libs. - -* Thu Jul 21 2011 Petr Sabata - 1.24.3-7.20110324svn3310 -- Perl mass rebuild - -* Wed Jul 20 2011 Petr Sabata - 1.24.3-6.20110324svn3310 -- Perl mass rebuild - -* Mon May 09 2011 Jason L Tibbitts III - 1.24.3-5.20110324svn3310 -- Bump for gnutls update. - -* Thu Mar 24 2011 Jason L Tibbitts III - 1.24.3-4.20110324svn3310 -- Update to latest 1.24.3 subversion. Turns out that what upstream was calling - 1.24.3 is really just an occasionally updated devel snapshot. -- Rebase various patches. - -* Wed Mar 23 2011 Dan Horák - 1.24.3-3 -- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient) - -* Tue Feb 08 2011 Fedora Release Engineering - 1.24.3-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Tue Jan 25 2011 Jason L Tibbitts III - 1.24.3-1 -- Update to latest upstream version. -- Rebase patches. -- Initial incomplete attempt to disable v4l1 support. - -* Fri Jan 21 2011 Jason L Tibbitts III - 1.24.2-6 -- Unbundle cambozola; instead link to the separately pacakged copy. -- Remove BuildRoot:, %%clean and buildroot cleaning in %%install. -- Git rid of mixed space/tab usage by removing all tabs. -- Remove unnecessary Conflicts: line. -- Attempt to force short_open_tag on for the code directories. -- Move default location of sockets, swaps, logfiles and some temporary files to - make more sense and allow things to work better with a future selinux policy. -- Fix errors in README.Fedora. - -* Wed Jun 02 2010 Marcela Maslanova - 1.24.2-5 -- Mass rebuild with perl-5.12.0 - -* Fri Dec 4 2009 Stepan Kasal - 1.24.2-4 -- rebuild against perl 5.10.1 -- use Perl vendorarch and archlib variables correctly - -* Mon Jul 27 2009 Fedora Release Engineering - 1.24.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Wed Jul 22 2009 Jason L Tibbitts III - 1.24.2-2 -- Bump release since 1.24.2-1 was mistakenly tagged a few months ago. - -* Wed Jul 22 2009 Jason L Tibbitts III - 1.24.2-1 -- Initial update to 1.24.2. -- Rebase patches. -- Update mootools download location. -- Update to mootools 1.2.3. -- Add additional dependencies for some optional features. - -* Sat Apr 11 2009 Martin Ebourne - 1.24.1-3 -- Remove unused Sys::Mmap perl dependency RPM is finding - -* Sat Apr 11 2009 Martin Ebourne - 1.24.1-2 -- Update gcc44 patch to disable -frepo, seems to be broken with gcc44 -- Added noffmpeg patch to make building outside mock easier - -* Sat Mar 21 2009 Martin Ebourne - 1.24.1-1 -- Patch for gcc 4.4 compilation errors -- Upgrade to 1.24.1 - -* Wed Feb 25 2009 Fedora Release Engineering - 1.23.3-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Sat Jan 24 2009 Caolán McNamara - 1.23.3-3 -- rebuild for dependencies - -* Mon Dec 15 2008 Martin Ebourne - 1.23.3-2 -- Fix permissions on zm.conf - -* Fri Jul 11 2008 Jason L Tibbitts III - 1.23.3-1 -- Initial attempt at packaging 1.23. - -* Tue Jul 1 2008 Martin Ebourne - 1.22.3-15 -- Add perl module compat dependency, bz #453590 - -* Tue May 6 2008 Martin Ebourne - 1.22.3-14 -- Remove default runlevel, bz #441315 - -* Mon Apr 28 2008 Jason L Tibbitts III - 1.22.3-13 -- Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3. - -* Tue Feb 19 2008 Fedora Release Engineering - 1.22.3-12 -- Autorebuild for GCC 4.3 - -* Thu Jan 3 2008 Martin Ebourne - 1.22.3-11 -- Fix compilation on gcc 4.3 - -* Thu Dec 6 2007 Martin Ebourne - 1.22.3-10 -- Rebuild for new openssl - -* Thu Aug 2 2007 Martin Ebourne - 1.22.3-8 -- Fix licence tag - -* Thu Jul 12 2007 Martin Ebourne - 1.22.3-7 -- Fixes from testing by Jitz including missing dependencies and database creation - -* Sat Jun 30 2007 Martin Ebourne - 1.22.3-6 -- Disable crashtrace on ppc - -* Sat Jun 30 2007 Martin Ebourne - 1.22.3-5 -- Fix uid for directories in /var/lib/zoneminder - -* Tue Jun 26 2007 Martin Ebourne - 1.22.3-4 -- Added perl Archive::Tar dependency -- Disabled web interface due to lack of access control on the event images - -* Sun Jun 10 2007 Martin Ebourne - 1.22.3-3 -- Changes recommended in review by Jason Tibbitts - -* Mon Apr 2 2007 Martin Ebourne - 1.22.3-2 -- Standardised on package name of zoneminder - -* Thu Dec 28 2006 Martin Ebourne - 1.22.3-1 -- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin diff --git a/distros/fedora/zoneminder.f22.spec b/distros/fedora/zoneminder.f22.spec new file mode 120000 index 000000000..808e7cb9f --- /dev/null +++ b/distros/fedora/zoneminder.f22.spec @@ -0,0 +1 @@ +zoneminder.f23.spec \ No newline at end of file diff --git a/distros/fedora/zoneminder.f23.spec b/distros/fedora/zoneminder.f23.spec index 1f44e5671..5335b90cc 100644 --- a/distros/fedora/zoneminder.f23.spec +++ b/distros/fedora/zoneminder.f23.spec @@ -179,6 +179,7 @@ fi %{perl_vendorlib}/ONVIF* %{perl_vendorlib}/WSDiscovery* %{perl_vendorlib}/WSSecurity* +%{perl_vendorlib}/WSNotification* %{_mandir}/man*/* %dir %{_libexecdir}/zoneminder %{_libexecdir}/zoneminder/cgi-bin diff --git a/distros/redhat/zoneminder.el6.spec b/distros/redhat/zoneminder.el6.spec index baf89ca8a..0b7770b50 100644 --- a/distros/redhat/zoneminder.el6.spec +++ b/distros/redhat/zoneminder.el6.spec @@ -168,6 +168,7 @@ rm -rf %{_docdir}/%{name}-%{version} %{perl_vendorlib}/ONVIF* %{perl_vendorlib}/WSDiscovery* %{perl_vendorlib}/WSSecurity* +%{perl_vendorlib}/WSNotification* %{_mandir}/man*/* %dir %{_libexecdir}/%{name} %{_libexecdir}/%{name}/cgi-bin diff --git a/distros/redhat/zoneminder.el7.spec b/distros/redhat/zoneminder.el7.spec index 3ec03b746..b72e0bbe7 100644 --- a/distros/redhat/zoneminder.el7.spec +++ b/distros/redhat/zoneminder.el7.spec @@ -177,6 +177,7 @@ fi %{perl_vendorlib}/ONVIF* %{perl_vendorlib}/WSDiscovery* %{perl_vendorlib}/WSSecurity* +%{perl_vendorlib}/WSNotification* %{_mandir}/man*/* %dir %{_libexecdir}/zoneminder %{_libexecdir}/zoneminder/cgi-bin From e90024c0d05741c3bbe06c91a9fdd3009a7a0e0c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 9 Apr 2016 09:27:12 -0400 Subject: [PATCH 03/10] Better Error logging on disk_total_space failure --- web/includes/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/includes/functions.php b/web/includes/functions.php index 25d81bb44..6d95253a3 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -1668,6 +1668,10 @@ function getLoad() function getDiskPercent() { $total = disk_total_space(ZM_DIR_EVENTS); + if ( ! $total ) { + Error("disk_total_space returned false for " . ZM_DIR_EVENTS ); + return 0; + } $space = round(($total - disk_free_space(ZM_DIR_EVENTS)) / $total * 100); return( $space ); } From a6500bc61e7c19fc279ff3d2439fcc65cccac839 Mon Sep 17 00:00:00 2001 From: "Jan M. Hochstein" Date: Sat, 9 Apr 2016 16:53:41 +0200 Subject: [PATCH 04/10] Added XML header in serializer --- onvif/modules/lib/ONVIF/Serializer/Base.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/onvif/modules/lib/ONVIF/Serializer/Base.pm b/onvif/modules/lib/ONVIF/Serializer/Base.pm index 7bab331cf..adbb173c6 100644 --- a/onvif/modules/lib/ONVIF/Serializer/Base.pm +++ b/onvif/modules/lib/ONVIF/Serializer/Base.pm @@ -97,8 +97,11 @@ sub serialize { my $soap_prefix = $opt->{ namespace }->{ $SOAP_NS }; - # envelope start with namespaces - my $xml = "<$soap_prefix\:Envelope "; + # XML starts with header + my $xml = "\n"; + + # envelope starts with namespaces + $xml .= "<$soap_prefix\:Envelope "; while (my ($uri, $prefix) = each %{ $opt->{ namespace } }) { From ce6f8da098644ed7db8c46861f478bf588ee2b75 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 9 Apr 2016 11:23:35 -0400 Subject: [PATCH 05/10] Use PDO::error_string instead of mysql_error --- web/includes/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/includes/database.php b/web/includes/database.php index 2d7bfd7a9..809145032 100644 --- a/web/includes/database.php +++ b/web/includes/database.php @@ -81,7 +81,7 @@ function dbLog( $sql, $update=false ) function dbError( $sql ) { - Fatal( "SQL-ERR '".mysql_error()."', statement was '".$sql."'" ); + Fatal( "SQL-ERR '".$dbConn->errorInfo()."', statement was '".$sql."'" ); } function dbEscape( $string ) From feb7b36f11e259fe0c64e60a00aa751d928d662f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 9 Apr 2016 11:23:52 -0400 Subject: [PATCH 06/10] use a local variable to prevent modifying the arguments --- web/includes/functions.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 6d95253a3..41b000a4d 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -1307,26 +1307,30 @@ function executeFilter( $filter ) return( $status ); } +# This takes more than one scale amount, so it runs through each and alters dimension. +# I can't imagine why you would want to do that. function reScale( $dimension, $dummy ) { + $new_dimension = $dimension; for ( $i = 1; $i < func_num_args(); $i++ ) { $scale = func_get_arg( $i ); if ( !empty($scale) && $scale != SCALE_BASE ) - $dimension = (int)(($dimension*$scale)/SCALE_BASE); + $new_dimension = (int)(($new_dimension*$scale)/SCALE_BASE); } - return( $dimension ); + return( $new_dimension ); } function deScale( $dimension, $dummy ) { + $new_dimension = $dimension; for ( $i = 1; $i < func_num_args(); $i++ ) { $scale = func_get_arg( $i ); if ( !empty($scale) && $scale != SCALE_BASE ) - $dimension = (int)(($dimension*SCALE_BASE)/$scale); + $new_dimension = (int)(($new_dimension*SCALE_BASE)/$scale); } - return( $dimension ); + return( $new_dimension ); } function monitorLimitSql() From 0c8e0ac220fa651a3a959e293ff6ac2b0a553bca Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 9 Apr 2016 11:24:59 -0400 Subject: [PATCH 07/10] change quotes to prevent php7 complaint --- web/skins/classic/views/zone.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/skins/classic/views/zone.php b/web/skins/classic/views/zone.php index 69c0919e9..48bffe0b0 100644 --- a/web/skins/classic/views/zone.php +++ b/web/skins/classic/views/zone.php @@ -29,7 +29,7 @@ $zid = !empty($_REQUEST['zid'])?validInt($_REQUEST['zid']):0; $scale = SCALE_BASE; -$hicolor = "0x00ff00"; // Green +$hicolor = '0x00ff00'; // Green $presets = array(); $presetNames = array(); From c0c543e02996f5e08111c63436f0371e280d4d11 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 9 Apr 2016 11:25:56 -0400 Subject: [PATCH 08/10] change quotes to prevent php7 complaint --- web/ajax/zone.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ajax/zone.php b/web/ajax/zone.php index 905ef7ac1..bfa77a922 100644 --- a/web/ajax/zone.php +++ b/web/ajax/zone.php @@ -17,7 +17,7 @@ if ( canView( 'Monitors' ) ) { $wd = getcwd(); chdir( ZM_DIR_IMAGES ); - $hiColor = "0x00ff00"; + $hiColor = '0x00ff00'; $command = getZmuCommand( " -m ".$_REQUEST['mid']." -z" ); if ( !isset($_REQUEST['zid']) ) From c1526b8fe5567ad386d957ffb337fb01d9273284 Mon Sep 17 00:00:00 2001 From: Jon Burgess Date: Sat, 9 Apr 2016 17:02:36 +0100 Subject: [PATCH 09/10] ONVIF: Fix probe type header and add To header --- onvif/scripts/zmonvif-probe.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/onvif/scripts/zmonvif-probe.pl b/onvif/scripts/zmonvif-probe.pl index 6f318ef5e..93c12959f 100755 --- a/onvif/scripts/zmonvif-probe.pl +++ b/onvif/scripts/zmonvif-probe.pl @@ -31,6 +31,7 @@ require ONVIF::Client; require WSDiscovery10::Interfaces::WSDiscovery::WSDiscoveryPort; require WSDiscovery10::Elements::Types; require WSDiscovery10::Elements::Scopes; +require WSDiscovery10::Elements::To; require WSDiscovery::TransportUDP; @@ -178,9 +179,10 @@ sub discover my $result = $svc_discover->ProbeOp( { # WSDiscovery::Types::ProbeType - Types => { 'dn:NetworkVideoTransmitter', 'tds:Device' }, # QNameListType + Types => 'http://www.onvif.org/ver10/network/wsdl:NetworkVideoTransmitter http://www.onvif.org/ver10/device/wsdl:Device', # QNameListType Scopes => { value => '' }, - },, + }, + WSDiscovery10::Elements::To->new({ value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' }) ); # print $result . "\n"; @@ -197,9 +199,10 @@ sub discover $result = $svc_discover->ProbeOp( { # WSDiscovery::Types::ProbeType - Types => { 'dn:NetworkVideoTransmitter', 'tds:Device' }, # QNameListType + Types => 'http://www.onvif.org/ver10/network/wsdl:NetworkVideoTransmitter http://www.onvif.org/ver10/device/wsdl:Device', # QNameListType Scopes => { value => '' }, - },, + }, + WSDiscovery10::Elements::To->new({ value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' }) ); # print $result . "\n"; From 5542788a45692c040f7e987eb2af33db976a44f6 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 10 Apr 2016 18:45:38 -0500 Subject: [PATCH 10/10] make cannot write to content dir an error, rather than fatal --- web/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/index.php b/web/index.php index 72e6dc8c0..9bb2a8ca8 100644 --- a/web/index.php +++ b/web/index.php @@ -143,7 +143,7 @@ CORSHeaders(); // Check for valid content dirs if ( !is_writable(ZM_DIR_EVENTS) || !is_writable(ZM_DIR_IMAGES) ) { - Fatal( "Cannot write to content dirs('".ZM_DIR_EVENTS."','".ZM_DIR_IMAGES."'). Check that these exist and are owned by the web account user"); + Error( "Cannot write to content dirs('".ZM_DIR_EVENTS."','".ZM_DIR_IMAGES."'). Check that these exist and are owned by the web account user"); } if ( isset($_REQUEST['view']) )