diff --git a/cacti-fix-php7-db-access.patch b/cacti-fix-php7-db-access.patch new file mode 100644 index 0000000..009c981 --- /dev/null +++ b/cacti-fix-php7-db-access.patch @@ -0,0 +1,16 @@ +From f76503b790d059c59070c69e07a1ebe882aff30f Mon Sep 17 00:00:00 2001 +From: Patrick +Date: Sat, 13 May 2017 00:01:13 +0200 +Subject: [PATCH] Bugfix for issue#687 + +--- a/lib/data_query.php ++++ b/lib/data_query.php +@@ -762,7 +762,7 @@ function data_query_rewrite_indexes(&$errmsg, $host_id, $snmp_query_id, $rewrite + foreach($oid_items as $item){ + $matches = array(); + if(preg_match('/^\|query_([^|]+)\|$/', $item, $matches)){ +- $iv = mysql_real_escape_string($matches[1]); ++ $iv = db_qstr($matches[1]); + if(is_array($fields_processed) && !in_array($iv, $fields_processed)){ + $errmsg[] = "rewrite_index='$rewrite_index': '$iv' is not processed yet, could not use it as index source"; + continue; diff --git a/cacti.spec b/cacti.spec index 9ec9c2a..90a6a92 100644 --- a/cacti.spec +++ b/cacti.spec @@ -1,6 +1,6 @@ Name: cacti Version: 1.1.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: An rrd based graphing tool License: GPLv2+ URL: http://www.cacti.net/ @@ -9,13 +9,46 @@ Source1: cacti-httpd.conf Source2: cacti.logrotate Source3: cacti.README.fedora Source4: %{name}.cron - -Requires: php, php-gd, php-ldap, php-mbstring, php-mysql, php-pdo, php-process, php-snmp, php-xml +Patch0: cacti-fix-php7-db-access.patch + +# Requires PHP 5.3+ +Requires: php(language) >= 5.3 + +# DB access is managed via pdo_mysql +Requires: php-pdo_mysql + +# Core PHP libs/extensions required by Cacti +Requires: php-pdo +Requires: php-reflection +Requires: php-simplexml +Requires: php-ctype +Requires: php-date +Requires: php-dom +Requires: php-filter +Requires: php-gd +Requires: php-iconv +Requires: php-imap +Requires: php-intl +Requires: php-json +Requires: php-ldap +Requires: php-mbstring +Requires: php-openssl +Requires: php-pcntl +Requires: php-posix +Requires: php-session +Requires: php-snmp +Requires: php-sockets +Requires: php-spl +Requires: php-xml +Requires: php-zlib + +# Cacti Requirements Requires: mysql Requires: httpd Requires: rrdtool Requires: net-snmp, net-snmp-utils Requires: crontabs + Requires(pre): %{_sbindir}/useradd Requires(postun): /sbin/service Provides: bundled(js-jquery) = 3.1.0 @@ -34,6 +67,7 @@ driven. %prep %setup -q +%patch0 -p1 %build # cacti's build is a noop @@ -127,6 +161,10 @@ fi %attr(-,root,root) %{_localstatedir}/lib/%{name}/lib %changelog +* Sat May 13 2017 Morten Stevens - 1.1.6-2 +- Fix PHP requirements +- Cacti db access not compatible with PHP 7 (#1450578) + * Mon May 08 2017 Morten Stevens - 1.1.6-1 - Update to 1.1.6