[packages/cacti] - up to 1.2.1

arekm arekm at pld-linux.org
Wed Jan 23 13:32:33 CET 2019


commit e90920b50c8c5cc2d59b2f07a1f0490b7dc7c952
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Jan 23 13:32:26 2019 +0100

    - up to 1.2.1

 cacti-bug-1634.patch | 130 ---------------------------------------------------
 cacti-config.patch   |  16 +++----
 cacti-webroot.patch  |  15 +++---
 cacti.spec           |  15 +++---
 4 files changed, 22 insertions(+), 154 deletions(-)
---
diff --git a/cacti.spec b/cacti.spec
index 3003263..88a6a7d 100644
--- a/cacti.spec
+++ b/cacti.spec
@@ -4,12 +4,12 @@
 Summary:	Cacti is a PHP frontend for rrdtool
 Summary(pl.UTF-8):	Cacti - frontend w PHP do rrdtoola
 Name:		cacti
-Version:	1.1.38
-Release:	2
+Version:	1.2.1
+Release:	1
 License:	GPL v2
 Group:		Applications/WWW
 Source0:	http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
-# Source0-md5:	a1ffe414280ec6518de7f0f16a5960c5
+# Source0-md5:	dd90a6c851a14cc4d4019b32368a493f
 Source2:	%{name}.crontab
 Source3:	%{name}-apache.conf
 Source4:	%{name}-lighttpd.conf
@@ -17,7 +17,7 @@ Source5:	%{name}-rrdpath.sql
 Source7:	%{name}.logrotate
 
 Patch1:		%{name}-config.patch
-Patch2:		cacti-bug-1634.patch
+
 Patch3:		%{name}-ioerror.patch
 Patch4:		%{name}-webroot.patch
 Patch5:		%{name}-linux_memory.patch
@@ -143,7 +143,7 @@ Dokumentacja do Cacti w formacie HTML.
 %endif
 
 %patch1 -p1
-%patch2 -p1
+
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
@@ -189,8 +189,7 @@ cp -p *.php $RPM_BUILD_ROOT%{_appdir}
 # ls -1d */index.php | cut -d"/" -f1 | xargs
 cp -a cache/* $RPM_BUILD_ROOT/var/cache/%{name}
 ln -s /var/cache/%{name} $RPM_BUILD_ROOT%{_appdir}/cache
-cp -a cli formats images include install lib locales mibs plugins resource scripts sql $RPM_BUILD_ROOT%{_appdir}
-cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
+cp -a cli docs formats images include install lib locales mibs plugins resource scripts sql $RPM_BUILD_ROOT%{_appdir}
 mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
 
 cp -a log $RPM_BUILD_ROOT/var/log/%{name}
@@ -261,7 +260,7 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc README.md docs/CHANGELOG docs/txt/manual.txt
+%doc README.md CHANGELOG
 %dir %attr(750,root,http) %{_sysconfdir}
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
diff --git a/cacti-bug-1634.patch b/cacti-bug-1634.patch
deleted file mode 100644
index 2ebd54a..0000000
--- a/cacti-bug-1634.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-commit 32f1538a4a382b7b27e2340705e9b034f335ae6e
-Author: cigamit <jimmy at sqmail.org>
-Date:   Sat Jun 2 12:16:13 2018 -0500
-
-    Resolving Issue #1634
-    
-    * Default snmp quick print setting resulting in false poller ASSERTS on
-    some php releases
-    * Also enhance the cacti snmp functions to require only 3 or 4
-    parameters.
-    * Minor format change to the vendor file classSNMP.php.  No functional
-    change.
-
-diff --git a/include/phpsnmp/classSNMP.php b/include/phpsnmp/classSNMP.php
-index e0f5b86d..ffa4aa88 100644
---- a/include/phpsnmp/classSNMP.php
-+++ b/include/phpsnmp/classSNMP.php
-@@ -150,7 +150,7 @@ class SNMP {
- 				$backup['valueretrieval'] = snmp_get_valueretrieval();
- 				snmp_set_valueretrieval($this->valueretrieval);
- 
--				$backup['quick_print']    = snmp_get_quick_print();
-+				$backup['quick_print'] = snmp_get_quick_print();
- 				snmp_set_quick_print($this->quick_print);
- 
- 				if ($this->oid_output_format !== NULL) {
-diff --git a/lib/snmp.php b/lib/snmp.php
-index 885a07ee..382f94aa 100644
---- a/lib/snmp.php
-+++ b/lib/snmp.php
-@@ -47,8 +47,8 @@ if (!class_exists('SNMP')) {
- 	include_once($config['include_path'] . '/phpsnmp/classSNMP.php');
- }
- 
--function cacti_snmp_session($hostname, $community, $version, $auth_user, $auth_pass,
--	$auth_proto, $priv_pass, $priv_proto, $context, $engineid,
-+function cacti_snmp_session($hostname, $community, $version, $auth_user = '', $auth_pass = '',
-+	$auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '', $engineid = '',
- 	$port = 161, $timeout = 500, $retries = 0, $max_oids = 10) {
- 
- 	switch ($version) {
-@@ -74,6 +74,7 @@ function cacti_snmp_session($hostname, $community, $version, $auth_user, $auth_p
- 		$session->valueretrieval = SNMP_VALUE_LIBRARY;
- 	}
- 
-+	$session->quick_print = false;
- 	$session->max_oids = $max_oids;
- 
- 	if (read_config_option('oid_increasing_check_disable') == 'on') {
-@@ -105,8 +106,8 @@ function cacti_snmp_session($hostname, $community, $version, $auth_user, $auth_p
- 	return $session;
- }
- 
--function cacti_snmp_get($hostname, $community, $oid, $version, $auth_user, $auth_pass,
--	$auth_proto, $priv_pass, $priv_proto, $context,
-+function cacti_snmp_get($hostname, $community, $oid, $version, $auth_user = '', $auth_pass = '',
-+	$auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '',
- 	$port = 161, $timeout = 500, $retries = 0, $environ = SNMP_POLLER,
- 	$engineid = '', $value_output_format = SNMP_STRING_OUTPUT_GUESS) {
- 
-@@ -198,8 +199,8 @@ function cacti_snmp_get($hostname, $community, $oid, $version, $auth_user, $auth
- 	return $snmp_value;
- }
- 
--function cacti_snmp_get_raw($hostname, $community, $oid, $version, $auth_user, $auth_pass,
--	$auth_proto, $priv_pass, $priv_proto, $context,
-+function cacti_snmp_get_raw($hostname, $community, $oid, $version, $auth_user = '', $auth_pass = '',
-+	$auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '',
- 	$port = 161, $timeout = 500, $retries = 0, $environ = SNMP_POLLER,
- 	$engineid = '', $value_output_format = SNMP_STRING_OUTPUT_GUESS) {
- 
-@@ -287,8 +288,8 @@ function cacti_snmp_get_raw($hostname, $community, $oid, $version, $auth_user, $
- 	return $snmp_value;
- }
- 
--function cacti_snmp_getnext($hostname, $community, $oid, $version, $auth_user, $auth_pass,
--	$auth_proto, $priv_pass, $priv_proto, $context,
-+function cacti_snmp_getnext($hostname, $community, $oid, $version, $auth_user = '', $auth_pass = '',
-+	$auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '',
- 	$port = 161, $timeout = 500, $retries = 0, $environ = SNMP_POLLER,
- 	$engineid = '', $value_output_format = SNMP_STRING_OUTPUT_GUESS) {
- 
-@@ -530,8 +531,8 @@ function cacti_snmp_session_getnext($session, $oid) {
- 	return $out;
- }
- 
--function cacti_snmp_walk($hostname, $community, $oid, $version, $auth_user, $auth_pass,
--	$auth_proto, $priv_pass, $priv_proto, $context,
-+function cacti_snmp_walk($hostname, $community, $oid, $version, $auth_user = '', $auth_pass = '',
-+	$auth_proto = '', $priv_pass = '', $priv_proto = '', $context = '',
- 	$port = 161, $timeout = 500, $retries = 0, $max_oids = 10, $environ = SNMP_POLLER,
- 	$engineid = '', $value_output_format = SNMP_STRING_OUTPUT_GUESS) {
- 
-commit afa01553f574554f782bbed3d2f1efaa355df2d0
-Author: cigamit <jimmy at sqmail.org>
-Date:   Sat Jun 2 20:16:28 2018 -0500
-
-    Additional Change for Issue #1634
-
-diff --git a/cmd.php b/cmd.php
-index 0820444d..5a17c7c6 100644
---- a/cmd.php
-+++ b/cmd.php
-@@ -525,7 +525,7 @@ if ((sizeof($polling_items) > 0) && (read_config_option('poller_enabled') == 'on
- 
- 							if (isset($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']])) {
- 								$sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']]->quick_print = true;
--								$output = cacti_snmp_session_get($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']], $index_item['arg1'], true);
-+								$output = cacti_snmp_session_get($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']], $index_item['arg1']);
- 							} else {
- 								$output = 'U';
- 							}
-commit 9311987e8a22e9c838bc879ff8eceae7abfbeb65
-Author: cigamit <jimmy at sqmail.org>
-Date:   Sat Jun 2 20:26:48 2018 -0500
-
-    Last update for issue #1634
-
-diff --git a/cmd.php b/cmd.php
-index 5a17c7c6..3061dc41 100644
---- a/cmd.php
-+++ b/cmd.php
-@@ -524,7 +524,6 @@ if ((sizeof($polling_items) > 0) && (read_config_option('poller_enabled') == 'on
- 							open_snmp_session($host_id, $item);
- 
- 							if (isset($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']])) {
--								$sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']]->quick_print = true;
- 								$output = cacti_snmp_session_get($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']], $index_item['arg1']);
- 							} else {
- 								$output = 'U';
diff --git a/cacti-config.patch b/cacti-config.patch
index cc6e304..b656fba 100644
--- a/cacti-config.patch
+++ b/cacti-config.patch
@@ -37,13 +37,13 @@
  
 --- cacti/poller.php~	2017-08-28 05:48:36.000000000 +0200
 +++ cacti/poller.php	2017-08-31 08:39:19.780902180 +0200
-@@ -61,7 +61,7 @@ if (!isset($_SERVER['argv'][0]) || isset
- }
+@@ -26,7 +26,7 @@
+ /* tick use required as of PHP 4.3.0 to accomodate signal handling */
+ declare(ticks = 1);
  
- /* start initialization section */
--include(dirname(__FILE__) . '/include/global.php');
-+require "/usr/share/cacti/include/global.php";
- include_once($config['base_path'] . '/lib/poller.php');
- include_once($config['base_path'] . '/lib/data_query.php');
- include_once($config['base_path'] . '/lib/rrd.php');
+-require(__DIR__ . '/include/cli_check.php');
++require('/usr/share/cacti/include/cli_check.php');
+ require_once($config['base_path'] . '/lib/poller.php');
+ require_once($config['base_path'] . '/lib/data_query.php');
+ require_once($config['base_path'] . '/lib/rrd.php');
 
diff --git a/cacti-webroot.patch b/cacti-webroot.patch
index 4221877..5936c1f 100644
--- a/cacti-webroot.patch
+++ b/cacti-webroot.patch
@@ -1,13 +1,12 @@
 --- /poller.php~	2008-10-05 16:54:15.000000000 +0300
 +++ /poller.php	2008-10-05 16:57:05.946911539 +0300
-@@ -320,7 +320,8 @@ while ($poller_runs_completed < $poller_
+@@ -424,7 +424,7 @@ while ($poller_runs_completed < $poller_
+ 	$started_processes = 0;
+ 	$first_host        = 0;
  	$last_host         = 0;
+-	$webroot           = addslashes(($config['cacti_server_os'] == 'win32') ? strtr(strtolower(substr(dirname(__FILE__), 0, 1)) . substr(dirname(__FILE__), 1),"\\", '/') : dirname(__FILE__));
++	$webroot = $config['base_path'];
  
- 	/* update web paths for the poller */
--	db_execute("REPLACE INTO settings (name, value) VALUES ('path_webroot','" . addslashes(($config['cacti_server_os'] == 'win32') ? strtr(strtolower(substr(dirname(__FILE__), 0, 1)) . substr(dirname(__FILE__), 1),"\\", '/') : dirname(__FILE__)) . "')");
-+	$path_webroot = $config['base_path'];
-+	db_execute("REPLACE INTO settings (name,value) VALUES ('path_webroot','" .  addslashes($path_webroot) . "')");
- 
- 	/* obtain some defaults from the database */
- 	$poller_type = read_config_option('poller_type');
+ 	// update web paths for the poller
+ 	set_config_option('path_webroot', $webroot);
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cacti.git/commitdiff/e90920b50c8c5cc2d59b2f07a1f0490b7dc7c952



More information about the pld-cvs-commit mailing list