[packages/cacti] - drop obsolete files

glen glen at pld-linux.org
Tue Oct 30 18:41:53 CET 2012


commit c35b930c516b1a17c0731e72ebebb99139be7ca2
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Oct 30 19:40:31 2012 +0200

    - drop obsolete files

 cacti-0.8.7g-sqli-xss.patch            | 115 -----------
 cacti-page_length_graph_view.patch     |  12 --
 cli_add_graph.patch                    |  11 --
 cross_site_fix.patch                   | 175 -----------------
 data_source_deactivate.patch           |  17 --
 fix_icmp_on_windows_iis_servers.patch  |  84 --------
 graph_list_view.patch                  | 110 -----------
 html_output.patch                      |  71 -------
 ldap_group_authenication.patch         |  11 --
 ping.patch                             |  23 ---
 poller_interval.patch                  | 168 ----------------
 script_server_command_line_parse.patch | 136 -------------
 snmp_invalid_response.patch            |  25 ---
 sql_injection_template_export.patch    |  13 --
 template_duplication.patch             | 232 ----------------------
 unified_issues.patch                   | 348 ---------------------------------
 16 files changed, 1551 deletions(-)
---
diff --git a/cacti-0.8.7g-sqli-xss.patch b/cacti-0.8.7g-sqli-xss.patch
deleted file mode 100644
index de8c6a6..0000000
--- a/cacti-0.8.7g-sqli-xss.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-diff -ur cacti-0.8.7g.orig/data_input.php cacti-0.8.7g/data_input.php
---- cacti-0.8.7g.orig/data_input.php	2010-07-10 00:33:46.000000000 +0200
-+++ cacti-0.8.7g/data_input.php	2011-04-14 21:10:24.658500117 +0200
-@@ -386,7 +386,7 @@
- 	html_end_box();
- 
- 	if (!empty($_GET["id"])) {
--		html_start_box("<strong>Input Fields</strong>", "100%", $colors["header"], "3", "center", "data_input.php?action=field_edit&type=in&data_input_id=" . $_GET["id"]);
-+		html_start_box("<strong>Input Fields</strong>", "100%", $colors["header"], "3", "center", "data_input.php?action=field_edit&type=in&data_input_id=" . htmlspecialchars(get_request_var("id")));
- 		print "<tr bgcolor='#" . $colors["header_panel"] . "'>";
- 			DrawMatrixHeaderItem("Name",$colors["header_text"],1);
- 			DrawMatrixHeaderItem("Field Order",$colors["header_text"],1);
-diff -ur cacti-0.8.7g.orig/graphs.php cacti-0.8.7g/graphs.php
---- cacti-0.8.7g.orig/graphs.php	2010-07-10 00:33:46.000000000 +0200
-+++ cacti-0.8.7g/graphs.php	2011-04-14 21:13:55.043000147 +0200
-@@ -1118,7 +1118,7 @@
- 	</script>
- 	<?php
- 
--	html_start_box("<strong>Graph Management</strong>", "100%", $colors["header"], "3", "center", "graphs.php?action=graph_edit&host_id=" . get_request_var_request("host_id"));
-+	html_start_box("<strong>Graph Management</strong>", "100%", $colors["header"], "3", "center", "graphs.php?action=graph_edit&host_id=" . htmlspecialchars(get_request_var_request("host_id")));
- 
- 	?>
- 	<tr bgcolor="#<?php print $colors["panel"];?>">
-diff -ur cacti-0.8.7g.orig/graph_templates.php cacti-0.8.7g/graph_templates.php
---- cacti-0.8.7g.orig/graph_templates.php	2010-07-10 00:33:46.000000000 +0200
-+++ cacti-0.8.7g/graph_templates.php	2011-04-14 21:12:45.854000138 +0200
-@@ -302,12 +302,12 @@
- 
- 		$header_label = "[edit: " . db_fetch_cell("select name from graph_templates where id=" . $_GET["id"]) . "]";
- 	}
--
--	html_start_box("<strong>Graph Template Items</strong> " . htmlspecialchars($header_label), "100%", $colors["header"], "3", "center", "graph_templates_items.php?action=item_edit&graph_template_id=" . $_GET["id"]);
-+	
-+	html_start_box("<strong>Graph Template Items</strong> " . htmlspecialchars($header_label), "100%", $colors["header"], "3", "center", "graph_templates_items.php?action=item_edit&graph_template_id=" . htmlspecialchars(get_request_var("id")));
- 	draw_graph_items_list($template_item_list, "graph_templates_items.php", "graph_template_id=" . $_GET["id"], false);
- 	html_end_box();
- 
--	html_start_box("<strong>Graph Item Inputs</strong>", "100%", $colors["header"], "3", "center", "graph_templates_inputs.php?action=input_edit&graph_template_id=" . $_GET["id"]);
-+	html_start_box("<strong>Graph Item Inputs</strong>", "100%", $colors["header"], "3", "center", "graph_templates_inputs.php?action=input_edit&graph_template_id=" . htmlspecialchars(get_request_var("id")));
- 
- 	print "<tr bgcolor='#" . $colors["header_panel"] . "'>";
- 		DrawMatrixHeaderItem("Name",$colors["header_text"],2);
-diff -ur cacti-0.8.7g.orig/host.php cacti-0.8.7g/host.php
---- cacti-0.8.7g.orig/host.php	2010-07-10 00:33:46.000000000 +0200
-+++ cacti-0.8.7g/host.php	2011-04-14 21:07:38.703500166 +0200
-@@ -333,7 +333,7 @@
- 	/* add a list of tree names to the actions dropdown */
- 	add_tree_names_to_actions_array();
- 
--	html_start_box("<strong>" . $device_actions{$_POST["drp_action"]} . "</strong>", "60%", $colors["header_panel"], "3", "center", "");
-+	html_start_box("<strong>" . $device_actions[get_request_var_post("drp_action")] . "</strong>", "60%", $colors["header_panel"], "3", "center", "");
- 
- 	print "<form action='host.php' autocomplete='off' method='post'>\n";
- 
-@@ -1189,7 +1189,7 @@
- 	</script>
- 	<?php
- 
--	html_start_box("<strong>Devices</strong>", "100%", $colors["header"], "3", "center", "host.php?action=edit&host_template_id=" . get_request_var_request("host_template_id") . "&host_status=" . get_request_var_request("host_status"));
-+	html_start_box("<strong>Devices</strong>", "100%", $colors["header"], "3", "center", "host.php?action=edit&host_template_id=" . htmlspecialchars(get_request_var_request("host_template_id")) . "&host_status=" . htmlspecialchars(get_request_var_request("host_status")));
- 
- 	?>
- 	<tr bgcolor="#<?php print $colors["panel"];?>">
-diff -ur cacti-0.8.7g.orig/templates_export.php cacti-0.8.7g/templates_export.php
---- cacti-0.8.7g.orig/templates_export.php	2010-07-10 00:33:46.000000000 +0200
-+++ cacti-0.8.7g/templates_export.php	2011-04-14 21:15:29.790000150 +0200
-@@ -93,7 +93,7 @@
- 				<select name="cbo_graph_id" onChange="window.location=document.form_graph_id.cbo_graph_id.options[document.form_graph_id.cbo_graph_id.selectedIndex].value">
- 					<?php
- 					while (list($key, $array) = each($export_types)) {
--						print "<option value='templates_export.php?export_type=$key'"; if ($_REQUEST["export_type"] == $key) { print " selected"; } print ">" . $array["name"] . "</option>\n";
-+						print "<option value='templates_export.php?export_type=" . htmlspecialchars($key) . "'"; if ($_REQUEST["export_type"] == $key) { print " selected"; } print ">" . $array["name"] . "</option>\n";
- 					}
- 					?>
- 				</select>
-diff -ur cacti-0.8.7g.orig/tree.php cacti-0.8.7g/tree.php
---- cacti-0.8.7g.orig/tree.php	2010-07-10 00:33:46.000000000 +0200
-+++ cacti-0.8.7g/tree.php	2011-04-14 21:18:53.174500150 +0200
-@@ -141,7 +141,7 @@
- 	/* ==================================================== */
- 
- 	if (!empty($_GET["id"])) {
--		$tree_item = db_fetch_row("select * from graph_tree_items where id=" . $_GET["id"]);
-+		$tree_item = db_fetch_row("select * from graph_tree_items where id=" . get_request_var("id"));
- 
- 		if ($tree_item["local_graph_id"] > 0) { $db_type = TREE_ITEM_TYPE_GRAPH; }
- 		if ($tree_item["title"] != "") { $db_type = TREE_ITEM_TYPE_HEADER; }
-@@ -156,7 +156,7 @@
- 		$current_type = TREE_ITEM_TYPE_HEADER;
- 	}
- 
--	$tree_sort_type = db_fetch_cell("select sort_type from graph_tree where id='" . $_GET["tree_id"] . "'");
-+	$tree_sort_type = db_fetch_cell("select sort_type from graph_tree where id='" . get_request_var("tree_id") . "'");
- 
- 	print "<form method='post' action='tree.php' name='form_tree'>\n";
- 
-@@ -429,13 +429,13 @@
- 	html_end_box();
- 
- 	if (!empty($_GET["id"])) {
--		html_start_box("<strong>Tree Items</strong>", "100%", $colors["header"], "3", "center", "tree.php?action=item_edit&tree_id=" . $tree["id"] . "&parent_id=0");
-+		html_start_box("<strong>Tree Items</strong>", "100%", $colors["header"], "3", "center", "tree.php?action=item_edit&tree_id=" . htmlspecialchars($tree["id"]) . "&parent_id=0");
- 
- 		?>
- 		<td>
--		<input type='button' onClick='return document.location="tree.php?action=edit&id=<?php print $_GET["id"];?>&subaction=expand_all"' value='Expand All' title='Expand All Trees'>
--		<input type='button' onClick='return document.location="tree.php?action=edit&id=<?php print $_GET["id"];?>&subaction=collapse_all"' value='Collapse All' title='Collapse All Trees'></a>
--		</td>
-+		<input type='button' onClick='return document.location="tree.php?action=edit&id=<?php print htmlspecialchars(get_request_var("id"));?>&subaction=expand_all"' value='Expand All' title='Expand All Trees'>
-+		<input type='button' onClick='return document.location="tree.php?action=edit&id=<?php print htmlspecialchars(get_request_var("id"));?>&subaction=collapse_all"' value='Collapse All' title='Collapse All Trees'></a>		
-+		</td>	
- 		<?php
- 
- 		print "<tr bgcolor='#" . $colors["header_panel"] . "'>";
diff --git a/cacti-page_length_graph_view.patch b/cacti-page_length_graph_view.patch
deleted file mode 100644
index 9e6a39c..0000000
--- a/cacti-page_length_graph_view.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN cacti-0.8.7d.orig/lib/html.php cacti-0.8.7d/lib/html.php
---- cacti-0.8.7d.orig/lib/html.php	2009-03-09 20:24:47.000000000 +0100
-+++ cacti-0.8.7d/lib/html.php	2009-03-09 20:34:09.000000000 +0100
-@@ -143,7 +143,7 @@
- 					<table align='center' cellpadding='0'>
- 						<tr>
- 							<td align='center'>
--								<a href='<?php print $config['url_path']; ?>graph.php?action=view&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=all'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' src='<?php print $config['url_path']; ?>graph_image.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0<?php print (($extra_url_args == "") ? "" : "&$extra_url_args");?>' border='0' alt='<?php print $graph["title_cache"];?>'></a>
-+								<div style="min-height: <?php echo (1.6 * read_config_option("export_default_height")) . "px"?>;"><a href='<?php print $config['url_path'];?>graph.php?action=view&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=all'><img class='graphimage' id='graph_<?php print $graph["local_graph_id"] ?>' src='<?php print $config['url_path']; ?>graph_image.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0<?php print (($extra_url_args == "") ? "" : "&$extra_url_args");?>' border='0' alt='<?php print $graph["title_cache"];?>'></a></div>
- 								<?php print (read_graph_config_option("show_graph_title") == "on" ? "<p style='font-size: 10;' align='center'><strong>" . $graph["title_cache"] . "</strong></p>" : "");?>
- 							</td>
- 							<td valign='top' style='align: left; padding: 3px;' class='noprint'>
diff --git a/cli_add_graph.patch b/cli_add_graph.patch
deleted file mode 100644
index b82d21a..0000000
--- a/cli_add_graph.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ../tags/0.8.7e/cli/add_graphs.php	2009-06-28 12:34:31.000000000 -0400
-+++ 0.8.7/cli/add_graphs.php	2009-08-18 20:04:44.000000000 -0400
-@@ -570,7 +570,7 @@
- 	echo "                    3|Fields = Verify all Fields\n";
- 	echo "List Options:\n";
- 	echo "    --list-hosts\n";
--	echo "    --list-graph-templates [--host_template=[ID]]\n";
-+	echo "    --list-graph-templates [--host-template-id=[ID]]\n";
- 	echo "    --list-input-fields --graph-template-id=[ID]\n";
- 	echo "    --list-snmp-queries\n";
- 	echo "    --list-query-types  --snmp-query-id [ID]\n";
diff --git a/cross_site_fix.patch b/cross_site_fix.patch
deleted file mode 100644
index ddc9e2e..0000000
--- a/cross_site_fix.patch
+++ /dev/null
@@ -1,175 +0,0 @@
---- cacti-0.8.7e/graph.php	2009-06-28 12:07:11.000000000 -0400
-+++ cacti-0.8.7e-patched/graph.php	2009-11-21 23:10:16.000000000 -0500
-@@ -35,6 +35,8 @@
- /* ================= input validation ================= */
- input_validate_input_regex(get_request_var_request("rra_id"), "^([0-9]+|all)$");
- input_validate_input_number(get_request_var("local_graph_id"));
-+input_validate_input_number(get_request_var("graph_end"));
-+input_validate_input_number(get_request_var("graph_start"));
- input_validate_input_regex(get_request_var_request("view_type"), "^([a-zA-Z0-9]+)$");
- /* ==================================================== */
- 
---- cacti-0.8.7e/include/top_graph_header.php	2009-06-28 12:07:11.000000000 -0400
-+++ cacti-0.8.7e-patched/include/top_graph_header.php	2009-11-21 23:15:27.000000000 -0500
-@@ -58,7 +58,7 @@
- 		if ($_SESSION["custom"]) {
- 			print "<meta http-equiv=refresh content='99999'>\r\n";
- 		}else{
--			print "<meta http-equiv=refresh content='" . read_graph_config_option("page_refresh") . "'>\r\n";
-+			print "<meta http-equiv=refresh content='" . htmlspecialchars(read_graph_config_option("page_refresh"),ENT_QUOTES) . "'>\r\n";
- 		}
- 	}
- 	?>
-@@ -113,7 +113,7 @@
- 	</tr>
- 	<tr class="noprint">
- 		<td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
--			<img src="images/transparent_line.gif" width="<?php print read_graph_config_option("default_dual_pane_width");?>" height="2" border="0"><br>
-+			<img src="images/transparent_line.gif" width="<?php print htmlspecialchars(read_graph_config_option("default_dual_pane_width"));?>" height="2" border="0"><br>
- 		</td>
- 		<td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(images/shadow.gif); background-repeat: repeat-x;">
- 
-@@ -144,7 +144,7 @@
- 
- 	<tr>
- 		<?php if ((read_graph_config_option("default_tree_view_mode") == "2") && (($_REQUEST["action"] == "tree") || ((isset($_REQUEST["view_type"]) ? $_REQUEST["view_type"] : "") == "tree"))) { ?>
--		<td valign="top" style="padding: 5px; border-right: #aaaaaa 1px solid;" bgcolor='#efefef' width='<?php print read_graph_config_option("default_dual_pane_width");?>' class='noprint'>
-+		<td valign="top" style="padding: 5px; border-right: #aaaaaa 1px solid;" bgcolor='#efefef' width='<?php print htmlspecialchars(read_graph_config_option("default_dual_pane_width"));?>' class='noprint'>
- 			<table border=0 cellpadding=0 cellspacing=0><tr><td><font size=-2><a style="font-size:7pt;text-decoration:none;color:silver" href="http://www.treemenu.net/" target=_blank></a></font></td></tr></table>
- 			<?php grow_dhtml_trees(); ?>
- 			<script type="text/javascript">initializeDocument();</script>
---- cacti-0.8.7e/lib/html_form.php	2009-06-28 12:07:11.000000000 -0400
-+++ cacti-0.8.7e-patched/lib/html_form.php	2009-11-21 23:15:40.000000000 -0500
-@@ -235,13 +235,21 @@
- 
- 		if (sizeof($items) > 0) {
- 		foreach ($items as $item) {
--			print $item["name"] . "<br>";
-+			print htmlspecialchars($item["name"],ENT_QUOTES) . "<br>";
- 		}
- 		}
- 
- 		break;
-+	case 'font':
-+		form_font_box($field_name, $field_array["value"],
-+			((isset($field_array["default"])) ? $field_array["default"] : ""),
-+			$field_array["max_length"],
-+			((isset($field_array["size"])) ? $field_array["size"] : "40"), "text",
-+			((isset($field_array["form_id"])) ? $field_array["form_id"] : ""));
-+
-+		break;
- 	default:
--		print "<em>" . $field_array["value"] . "</em>";
-+		print "<em>" . htmlspecialchars($field_array["value"],ENT_QUOTES) . "</em>";
- 
- 		form_hidden_box($field_name, $field_array["value"], "");
- 
-@@ -384,7 +392,7 @@
- 		$form_previous_value = $form_default_value;
- 	}
- 
--	print "<input type='hidden' id='$form_name' name='$form_name' value='$form_previous_value'>\n";
-+	print "<input type='hidden' id='$form_name' name='$form_name' value='" . htmlspecialchars($form_previous_value, ENT_QUOTES) . "'>\n";
- }
- 
- /* form_dropdown - draws a standard html dropdown box
-@@ -568,7 +576,7 @@
- 			}
- 		}
- 
--		print ">". $array_display[$id];
-+		print ">". htmlspecialchars($array_display[$id],ENT_QUOTES);
- 		print "</option>\n";
- 	}
- 
-@@ -627,6 +635,65 @@
- 	print "</select>\n";
- }
- 
-+/* form_font_box - draws a standard html textbox and provides status of a fonts existence
-+   @arg $form_name - the name of this form element
-+   @arg $form_previous_value - the current value of this form element
-+   @arg $form_default_value - the value of this form element to use if there is
-+     no current value available
-+   @arg $form_max_length - the maximum number of characters that can be entered
-+     into this textbox
-+   @arg $form_size - the size (width) of the textbox
-+   @arg $type - the type of textbox, either 'text' or 'password'
-+   @arg $current_id - used to determine if a current value for this form element
-+     exists or not. a $current_id of '0' indicates that no current value exists,
-+     a non-zero value indicates that a current value does exist */
-+function form_font_box($form_name, $form_previous_value, $form_default_value, $form_max_length, $form_size = 30, $type = "text", $current_id = 0) {
-+	if (($form_previous_value == "") && (empty($current_id))) {
-+		$form_previous_value = $form_default_value;
-+	}
-+
-+	print "<input type='$type'";
-+
-+	if (isset($_SESSION["sess_error_fields"])) {
-+		if (!empty($_SESSION["sess_error_fields"][$form_name])) {
-+			print "class='txtErrorTextBox'";
-+			unset($_SESSION["sess_error_fields"][$form_name]);
-+		}
-+	}
-+
-+	if (isset($_SESSION["sess_field_values"])) {
-+		if (!empty($_SESSION["sess_field_values"][$form_name])) {
-+			$form_previous_value = $_SESSION["sess_field_values"][$form_name];
-+		}
-+	}
-+
-+	if (strlen($form_previous_value) == 0) { # no data: defaults are used; everythings fine
-+			$extra_data = "";
-+	} else {
-+		if (read_config_option("rrdtool_version") == "rrd-1.3.x") {	# rrdtool 1.3 uses fontconfig
-+			$font = '"' . $form_previous_value . '"';
-+			$out_array = array();
-+			exec('fc-list ' . $font, $out_array);
-+			if (sizeof($out_array) == 0) {
-+				$extra_data = "<span style='color:red'><br>[" . "ERROR: FONT NOT FOUND" . "]</span>";
-+			} else {
-+				$extra_data = "<span style='color:green'><br>[" . "OK: FONT FOUND" . "]</span>";
-+			}
-+		} elseif (read_config_option("rrdtool_version") == "rrd-1.0.x" ||
-+				  read_config_option("rrdtool_version") == "rrd-1.2.x") { # rrdtool 1.0 and 1.2 use font files
-+			if (is_file($form_previous_value)) {
-+				$extra_data = "<span style='color:green'><br>[" . "OK: FILE FOUND" . "]</span>";
-+			}else if (is_dir($form_previous_value)) {
-+				$extra_data = "<span style='color:red'><br>[" . "ERROR: IS DIR" . "]</span>";
-+			}else{
-+				$extra_data = "<span style='color:red'><br>[" . "ERROR: FILE NOT FOUND" . "]</span>";
-+			}
-+		} # will be used for future versions of rrdtool
-+	}
-+
-+	print " id='$form_name' name='$form_name' size='$form_size'" . (!empty($form_max_length) ? " maxlength='$form_max_length'" : "") . " value='" . htmlspecialchars($form_previous_value, ENT_QUOTES) . "'>" . $extra_data;
-+}
-+
- /* form_confirm - draws a table presenting the user with some choice and allowing
-      them to either proceed (delete) or cancel
-    @arg $body_text - the text to prompt the user with on this form
---- cacti-0.8.7e/lib/timespan_settings.php	2009-06-28 12:07:11.000000000 -0400
-+++ cacti-0.8.7e-patched/lib/timespan_settings.php	2009-11-21 23:15:49.000000000 -0500
-@@ -125,9 +125,9 @@
- 	if (isset($_POST["date1"])) {
- 		/* the dates have changed, therefore, I am now custom */
- 		if (($_SESSION["sess_current_date1"] != $_POST["date1"]) || ($_SESSION["sess_current_date2"] != $_POST["date2"])) {
--			$timespan["current_value_date1"] = $_POST["date1"];
-+			$timespan["current_value_date1"] = sanitize_search_string($_POST["date1"]);
- 			$timespan["begin_now"] =strtotime($timespan["current_value_date1"]);
--			$timespan["current_value_date2"] = $_POST["date2"];
-+			$timespan["current_value_date2"] = sanitize_search_string($_POST["date2"]);
- 			$timespan["end_now"]=strtotime($timespan["current_value_date2"]);
- 			$_SESSION["sess_current_timespan"] = GT_CUSTOM;
- 			$_SESSION["custom"] = 1;
-@@ -135,8 +135,8 @@
- 		}else {
- 			/* the default button wasn't pushed */
- 			if (!isset($_POST["button_clear_x"])) {
--				$timespan["current_value_date1"] = $_POST["date1"];
--				$timespan["current_value_date2"] = $_POST["date2"];
-+				$timespan["current_value_date1"] = sanitize_search_string($_POST["date1"]);
-+				$timespan["current_value_date2"] = sanitize_search_string($_POST["date2"]);
- 				$timespan["begin_now"] = $_SESSION["sess_current_timespan_begin_now"];
- 				$timespan["end_now"] = $_SESSION["sess_current_timespan_end_now"];
- 
diff --git a/data_source_deactivate.patch b/data_source_deactivate.patch
deleted file mode 100644
index 1a3f727..0000000
--- a/data_source_deactivate.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- cacti-0.8.7g/lib/api_data_source.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/lib/api_data_source.php	2010-07-27 21:30:31.000000000 -0400
-@@ -131,12 +131,12 @@
- 
- 			$i++;
- 
--			if ($i % 1000) {
-+			if (!($i % 1000)) {
- 				db_execute("DELETE FROM poller_item WHERE local_data_id IN ($ids_to_disable)");
- 				db_execute("UPDATE data_template_data SET active='' WHERE local_data_id IN ($ids_to_disable)");
- 
- 				$i = 0;
--				$ids_to_delete = "";
-+				$ids_to_disable = "";
- 			}
- 		}
- 
diff --git a/fix_icmp_on_windows_iis_servers.patch b/fix_icmp_on_windows_iis_servers.patch
deleted file mode 100644
index 472101c..0000000
--- a/fix_icmp_on_windows_iis_servers.patch
+++ /dev/null
@@ -1,84 +0,0 @@
---- cacti-0.8.7e/lib/ping.php	2009-06-28 12:07:11.000000000 -0400
-+++ cacti-0.8.7e-patched/lib/ping.php	2009-09-01 16:22:22.000000000 -0400
-@@ -156,10 +156,9 @@
- 						}
- 						socket_set_block($this->socket);
- 
-+						/* use traditional ping if we can't create a raw socket */
- 						if (!(@socket_connect($this->socket, $host_ip, NULL))) {
--							$this->ping_response = "Cannot connect to host";
--							$this->ping_status   = "down";
--							return false;
-+							break;
- 						}
- 
- 						/* set socket receive timeout as appropriate */
-@@ -234,8 +233,9 @@
- 						break;
- 					}
- 				}
--			}else{
--				/* we have to use the real ping */
-+			}
-+
-+			/* we have to use the real ping, in cases where windows failed or while using UNIX/Linux */
- 				$pattern  = bin2hex("cacti-monitoring-system"); // the actual test data
- 
- 				/* host timeout given in ms, recalculate to sec, but make it an integer */
-@@ -253,10 +253,13 @@
- 					$result = shell_exec("ping -w " . ceil($this->timeout/1000) . " -c " . $this->retries . " " . $this->host["hostname"]);
- 				}else if (substr_count(strtolower(PHP_OS), "aix")) {
- 					$result = shell_exec("ping -i " . ceil($this->timeout/1000) . " -c " . $this->retries . " " . $this->host["hostname"]);
-+			}else if (substr_count(strtolower(PHP_OS), "winnt")) {
-+				$result = shell_exec("ping -w " . $this->timeout . " -n " . $this->retries . " " . $this->host["hostname"]);
- 				}else{
- 					$result = shell_exec("ping -W " . ceil($this->timeout/1000) . " -c " . $this->retries . " -p " . $pattern . " " . $this->host["hostname"]);
- 				}
- 
-+			if (strtolower(PHP_OS) != "winnt") {
- 				$position = strpos($result, "min/avg/max");
- 
- 				if ($position > 0) {
-@@ -274,6 +277,24 @@
- 
- 					return false;
- 				}
-+			}else{
-+				$position = strpos($result, "Minimum");
-+
-+				if ($position > 0) {
-+					$output  = trim(substr($result, $position));
-+					$pieces  = explode(",", $output);
-+					$results = explode("=", $pieces[2]);
-+
-+					$this->ping_status = trim(str_replace("ms", "", $results[1]));
-+					$this->ping_response = "ICMP Ping Success (" . $this->ping_status . " ms)";
-+
-+					return true;
-+				}else{
-+					$this->status = "down";
-+					$this->ping_response = "ICMP ping Timed out";
-+
-+					return false;
-+				}
- 			}
- 		}else{
- 			$this->ping_status   = "down";
-@@ -642,7 +663,7 @@
- 		/* snmp test */
- 		if (($avail_method == AVAIL_SNMP_OR_PING) && ($ping_result == true)) {
- 			$snmp_result = true;
--			$snmp_status = 0.000;
-+			$this->snmp_status = 0.000;
- 		}else if (($avail_method == AVAIL_SNMP_AND_PING) && ($ping_result == false)) {
- 			$snmp_result = false;
- 		}else if (($avail_method == AVAIL_SNMP) || ($avail_method == AVAIL_SNMP_AND_PING)) {
-@@ -650,7 +671,7 @@
- 				/* snmp version 1/2 without community string assume SNMP test to be successful
- 				   due to backward compatibility issues */
- 				$snmp_result = true;
--				$snmp_status = 0.000;
-+				$this->snmp_status = 0.000;
- 			}else{
- 				$snmp_result = $this->ping_snmp();
- 			}
diff --git a/graph_list_view.patch b/graph_list_view.patch
deleted file mode 100644
index 47a5b72..0000000
--- a/graph_list_view.patch
+++ /dev/null
@@ -1,110 +0,0 @@
---- cacti-0.8.7g/graph_view.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/graph_view.php	2010-07-27 21:30:31.000000000 -0400
-@@ -204,7 +204,7 @@
- 		$sql_where = "";
- 		$sql_join = "";
- 	}
--	/* the user select a bunch of graphs of the 'list' view and wants them dsplayed here */
-+	/* the user select a bunch of graphs of the 'list' view and wants them displayed here */
- 	if (isset($_REQUEST["style"])) {
- 		if (get_request_var_request("style") == "selective") {
- 
-@@ -296,8 +296,9 @@
- 								$sql_where = get_graph_permissions_sql($current_user["policy_graphs"], $current_user["policy_hosts"], $current_user["policy_graph_templates"]);
- 
- 								$hosts = db_fetch_assoc("SELECT DISTINCT host.id, host.description as name
--									FROM (graph_templates_graph,graph_local)
--									LEFT JOIN host ON (host.id=graph_local.host_id)
-+									FROM host
-+									LEFT JOIN graph_local ON ( host.id = graph_local.host_id )
-+									LEFT JOIN graph_templates_graph ON ( graph_templates_graph.local_graph_id = graph_local.id )
- 									LEFT JOIN graph_templates ON (graph_templates.id=graph_local.graph_template_id)
- 									LEFT JOIN user_auth_perms ON ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
- 									WHERE graph_templates_graph.local_graph_id=graph_local.id
-@@ -327,8 +328,9 @@
- 							<?php
- 							if (read_config_option("auth_method") != 0) {
- 								$graph_templates = db_fetch_assoc("SELECT DISTINCT graph_templates.*
--									FROM (graph_templates_graph,graph_local)
--									LEFT JOIN host ON (host.id=graph_local.host_id)
-+									FROM host
-+									LEFT JOIN graph_local ON ( host.id = graph_local.host_id )
-+									LEFT JOIN graph_templates_graph ON ( graph_templates_graph.local_graph_id = graph_local.id )
- 									LEFT JOIN graph_templates ON (graph_templates.id=graph_local.graph_template_id)
- 									LEFT JOIN user_auth_perms ON ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
- 									WHERE graph_templates_graph.local_graph_id=graph_local.id
-@@ -514,10 +516,10 @@
- 	}else{
- 		/* if any of the settings changed, reset the page number */
- 		$changed = false;
--		$changed += check_changed("host_id", "sess_graphs_view_list_host");
--		$changed += check_changed("rows", "sess_graphs_view_list_rows");
--		$changed += check_changed("graph_template_id", "sess_graphs_view_list_graph_template");
--		$changed += check_changed("filter", "sess_graphs_view_list_filter");
-+		$changed += check_changed("host_id", "sess_graph_view_list_host");
-+		$changed += check_changed("rows", "sess_graph_view_list_rows");
-+		$changed += check_changed("graph_template_id", "sess_graph_view_list_graph_template");
-+		$changed += check_changed("filter", "sess_graph_view_list_filter");
- 		if ($changed) $_REQUEST["page"] = 1;
- 	}
- 
-@@ -563,7 +565,7 @@
- 	?>
- 	<tr bgcolor="#<?php print $colors["panel"];?>">
- 		<td>
--		<form style="margin:0px;padding:0px;" name="form_graph_list" method="POST" onSubmit='form_graph(document.chk,document.form_graph_list)' action="graph_view.php">
-+		<form style="margin:0px;padding:0px;" name="form_graph_list" method="POST" onSubmit='form_graph(document.chk,document.form_graph_list)'>
- 			<table width="100%" cellpadding="0" cellspacing="0">
- 				<tr>
- 					<td nowrap style='white-space: nowrap;' width="40">
-@@ -578,8 +580,9 @@
- 								$sql_where = get_graph_permissions_sql($current_user["policy_graphs"], $current_user["policy_hosts"], $current_user["policy_graph_templates"]);
- 
- 								$hosts = db_fetch_assoc("SELECT DISTINCT host.id, host.description as name
--									FROM (graph_templates_graph,graph_local)
--									LEFT JOIN host ON (host.id=graph_local.host_id)
-+									FROM host
-+									LEFT JOIN graph_local ON ( host.id = graph_local.host_id )
-+									LEFT JOIN graph_templates_graph ON ( graph_templates_graph.local_graph_id = graph_local.id )
- 									LEFT JOIN graph_templates ON (graph_templates.id=graph_local.graph_template_id)
- 									LEFT JOIN user_auth_perms ON ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
- 									WHERE graph_templates_graph.local_graph_id=graph_local.id
-@@ -608,8 +611,9 @@
- 							<?php
- 							if (read_config_option("auth_method") != 0) {
- 								$graph_templates = db_fetch_assoc("SELECT DISTINCT graph_templates.*
--									FROM (graph_templates_graph,graph_local)
--									LEFT JOIN host ON (host.id=graph_local.host_id)
-+									FROM host
-+									LEFT JOIN graph_local ON ( host.id = graph_local.host_id )
-+									LEFT JOIN graph_templates_graph ON ( graph_templates_graph.local_graph_id = graph_local.id )
- 									LEFT JOIN graph_templates ON (graph_templates.id=graph_local.graph_template_id)
- 									LEFT JOIN user_auth_perms ON ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
- 									WHERE graph_templates_graph.local_graph_id=graph_local.id
-@@ -736,13 +740,13 @@
- 
- 	html_start_box("", "100%", $colors["header"], "1", "center", "");
- 	print $nav;
--	html_header_checkbox(array("Graph Title", "Graph Size"));
-+	html_header_checkbox(array("Graph Title", "Graph Size"), false);
- 
- 	$i = 0;
- 	if (sizeof($graphs)) {
- 		foreach ($graphs as $graph) {
- 			form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $graph["local_graph_id"]); $i++;
--			form_selectable_cell("<strong><a href='" . htmlspecialchars("graph.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=all") . "'>" . htmlspecialchars($graph["title_cache"]) . "</a><strong>", $graph["local_graph_id"]);
-+			form_selectable_cell("<strong><a href='" . htmlspecialchars("graph.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=all") . "'>" . htmlspecialchars($graph["title_cache"]) . "</a></strong>", $graph["local_graph_id"]);
- 			form_selectable_cell($graph["height"] . "x" . $graph["width"], $graph["local_graph_id"]);
- 			form_checkbox_cell($graph["title_cache"], $graph["local_graph_id"]);
- 			form_end_row();
-@@ -795,8 +799,8 @@
- 		strDel = strDel.substring(0,strDel.length - 1);
- 		strURL = '&graph_add=' + strAdd + '&graph_remove=' + strDel;
- 		return strNavURL + strURL;
--		alert(strAdd);
--		alert(strDel);
-+		//alert(strAdd);
-+		//alert(strDel);
- 	}
- 	function url_go(strURL) {
- 		document.location = strURL;
diff --git a/html_output.patch b/html_output.patch
deleted file mode 100644
index 22f0985..0000000
--- a/html_output.patch
+++ /dev/null
@@ -1,71 +0,0 @@
---- cacti-0.8.7g/lib/html_form.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/lib/html_form.php	2010-07-27 21:30:31.000000000 -0400
-@@ -65,7 +65,7 @@
- 					form_alternate_row_color($colors["form_alternate1"], $colors["form_alternate2"], $i, 'row_' . $field_name);
- 				}
- 
--				print "<td width='" . ((isset($config_array["left_column_width"])) ? $config_array["left_column_width"] : "50%") . "'>\n<font class='textEditTitle'>" . htmlspecialchars($field_array["friendly_name"]) . "</font><br>\n";
-+				print "<td width='" . ((isset($config_array["left_column_width"])) ? $config_array["left_column_width"] : "50%") . "'>\n<font class='textEditTitle'>" . $field_array["friendly_name"] . "</font><br>\n";
- 
- 				if (isset($field_array["sub_checkbox"])) {
- 					form_checkbox($field_array["sub_checkbox"]["name"], $field_array["sub_checkbox"]["value"],
---- cacti-0.8.7g/lib/data_query.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/lib/data_query.php	2010-07-27 21:30:31.000000000 -0400
-@@ -620,6 +620,7 @@
- 	}
- 
- 	/* update the cache */
-+	/* TODO: if both $sort field and $title_format are empty, this yields funny results */
- 	db_execute("update host_snmp_query set sort_field = '$sort_field', title_format = '$title_format' where host_id = '$host_id' and snmp_query_id = '$data_query_id'");
- }
- 
---- cacti-0.8.7g/data_sources.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/data_sources.php	2010-07-27 21:30:31.000000000 -0400
-@@ -899,7 +899,7 @@
- 				<td bgcolor='#" . $colors["header"] . "' class='textHeaderDark'>
- 					<strong>Data Source Item</strong> $header_label
- 				</td>
--				<td class='textHeaderDark' align='right' bgcolor='" . $colors["header"] . "'>
-+				<td class='textHeaderDark' align='right' bgcolor='#" . $colors["header"] . "'>
- 					" . ((!empty($_GET["id"]) && (empty($data_template["id"]))) ? "<strong><a class='linkOverDark' href='" . htmlspecialchars("data_sources.php?action=rrd_add&id=" . $_GET["id"]) . "'>New</a> </strong>" : "") . "
- 				</td>
- 			</tr>\n";
-@@ -1310,16 +1310,17 @@
- 	$i = 0;
- 	if (sizeof($data_sources) > 0) {
- 		foreach ($data_sources as $data_source) {
--			$data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
--			$data_input_name    = ((empty($data_source["data_input_name"])) ? "<em>External</em>" : $data_source["data_input_name"]);
-+			/* we're escaping strings here, so no need to escape them on form_selectable_cell */
-+			$data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : htmlspecialchars($data_source["data_template_name"]));
-+			$data_input_name    = ((empty($data_source["data_input_name"])) ? "<em>External</em>" : htmlspecialchars($data_source["data_input_name"]));
- 			$poller_interval    = ((isset($poller_intervals[$data_source["local_data_id"]])) ? $poller_intervals[$data_source["local_data_id"]] : 0);
- 			form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $data_source["local_data_id"]); $i++;
- 			form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars("data_sources.php?action=ds_edit&id=" . $data_source["local_data_id"]) . "' title='" . $data_source["name_cache"] . "'>" . ((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", title_trim(htmlspecialchars($data_source["name_cache"]), read_config_option("max_title_data_source"))) : title_trim(htmlspecialchars($data_source["name_cache"]), read_config_option("max_title_data_source"))) . "</a>", $data_source["local_data_id"]);
- 			form_selectable_cell($data_source['local_data_id'], $data_source['local_data_id']);
--			form_selectable_cell(((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", htmlspecialchars($data_input_name)) : htmlspecialchars($data_input_name)), $data_source["local_data_id"]);
-+			form_selectable_cell(((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $data_input_name) : $data_input_name), $data_source["local_data_id"]);
- 			form_selectable_cell(get_poller_interval($poller_interval), $data_source["local_data_id"]);
- 			form_selectable_cell(($data_source['active'] == "on" ? "Yes" : "No"), $data_source["local_data_id"]);
--			form_selectable_cell(((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", htmlspecialchars($data_source['data_template_name'])) : htmlspecialchars($data_source['data_template_name'])), $data_source["local_data_id"]);
-+			form_selectable_cell(((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $data_template_name) : $data_template_name), $data_source["local_data_id"]);
- 			form_checkbox_cell($data_source["name_cache"], $data_source["local_data_id"]);
- 			form_end_row();
- 		}
---- cacti-0.8.7g/graphs.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/graphs.php	2010-07-27 21:30:31.000000000 -0400
-@@ -1317,11 +1317,12 @@
- 	$i = 0;
- 	if (sizeof($graph_list) > 0) {
- 		foreach ($graph_list as $graph) {
--			$template_name = ((empty($graph["name"])) ? "<em>None</em>" : $graph["name"]);
-+			/* we're escaping strings here, so no need to escape them on form_selectable_cell */
-+			$template_name = ((empty($graph["name"])) ? "<em>None</em>" : htmlspecialchars($graph["name"]));
- 			form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $graph["local_graph_id"]); $i++;
- 			form_selectable_cell("<a class='linkEditMain' href='" . htmlspecialchars("graphs.php?action=graph_edit&id=" . $graph["local_graph_id"]) . "' title='" . htmlspecialchars($graph["title_cache"]) . "'>" . ((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", title_trim(htmlspecialchars($graph["title_cache"]), read_config_option("max_title_graph"))) : title_trim(htmlspecialchars($graph["title_cache"]), read_config_option("max_title_graph"))) . "</a>", $graph["local_graph_id"]);
- 			form_selectable_cell($graph["local_graph_id"], $graph["local_graph_id"]);
--			form_selectable_cell(((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", htmlspecialchars($template_name)) : htmlspecialchars($template_name)), $graph["local_graph_id"]);
-+			form_selectable_cell(((get_request_var_request("filter") != "") ? eregi_replace("(" . preg_quote(get_request_var_request("filter")) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", $template_name) : $template_name), $graph["local_graph_id"]);
- 			form_selectable_cell($graph["height"] . "x" . $graph["width"], $graph["local_graph_id"]);
- 			form_checkbox_cell($graph["title_cache"], $graph["local_graph_id"]);
- 			form_end_row();
diff --git a/ldap_group_authenication.patch b/ldap_group_authenication.patch
deleted file mode 100644
index 00894c0..0000000
--- a/ldap_group_authenication.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- cacti-0.8.7g/lib/ldap.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/lib/ldap.php	2010-07-27 21:30:31.000000000 -0400
-@@ -250,7 +250,7 @@
- 			if ($ldap_response) {
- 				if ($this->group_require == 1) {
- 					/* Process group membership if required */
--					if ($ldap_group_member_type == 1) {
-+					if ($this->group_member_type == 1) {
- 						$ldap_group_response = @ldap_compare($ldap_conn, $this->group_dn, $this->group_attrib, $this->dn);
- 					} else {
- 						$ldap_group_response = @ldap_compare($ldap_conn, $this->group_dn, $this->group_attrib, $this->username);
diff --git a/ping.patch b/ping.patch
deleted file mode 100644
index a48050b..0000000
--- a/ping.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -ruBbd cacti-0.8.7g/lib/ping.php cacti-0.8.7g-patched/lib/ping.php
---- cacti-0.8.7g/lib/ping.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/lib/ping.php	2010-08-31 20:31:22.000000000 -0400
-@@ -577,12 +577,16 @@
- 				switch(socket_select($r = array($this->socket), $w = array($this->socket), $f = array($this->socket), $to_sec, $to_usec)){
- 				case 2:
- 					/* connection refused */
--					$this->ping_response = "TCP ping connection refused";
--					$this->ping_status   = "down";
-+					$this->time = $this->get_time($this->precision);
-+
-+					if (($this->time*1000) <= $this->timeout) {
-+						$this->ping_response = "TCP Ping connection refused (" . $this->time*1000 . " ms)";
-+						$this->ping_status   = $this->time*1000;
-+					}
- 
- 					$this->close_socket();
- 
--					return false;
-+					return true; /* "connection refused" says: host is alive (else ping would time out) */
- 				case 1:
- 					/* connected, so calculate the total time and return */
- 					$this->time = $this->get_time($this->precision);
diff --git a/poller_interval.patch b/poller_interval.patch
deleted file mode 100644
index dac3956..0000000
--- a/poller_interval.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-diff -ruBbd cacti-0.8.7g/lib/database.php cacti-0.8.7g-patched/lib/database.php
---- cacti-0.8.7g/lib/database.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/lib/database.php	2010-08-31 20:31:22.000000000 -0400
-@@ -38,14 +38,14 @@
- 	$cnn = NewADOConnection($db_type);
- 	$class = get_class($cnn);
- 	
--	if (!is_a($cnn_id, $class)) {
--		$cnn_id = $cnn;
--	}
--
- 	$hostport = $host . ":" . $port;
- 
- 	while ($i <= $retries) {
- 		if ($cnn->PConnect($hostport,$user,$pass,$db_name)) {
-+			if (!is_a($cnn_id, $class)) {
-+				$cnn_id = $cnn;
-+			}
-+
- 			return($cnn);
- 		}
- 
-@@ -92,7 +92,7 @@
- 	while (1) {
- 		$query = $db_conn->Execute($sql);
- 
--		if (($query) || ($db_conn->ErrorNo() == 1032)) {
-+		if (($db_conn->ErrorNo() == 0) || ($db_conn->ErrorNo() == 1032)) {
- 			return(1);
- 		}else if (($db_conn->ErrorNo() == 1049) || ($db_conn->ErrorNo() == 1051)) {
- 			printf("FATAL: Database or Table does not exist");
-@@ -143,7 +143,7 @@
- 
- 	$query = $db_conn->Execute($sql);
- 
--	if (($query) || ($db_conn->ErrorNo() == 1032)) {
-+	if (($db_conn->ErrorNo() == 0) || ($db_conn->ErrorNo() == 1032)) {
- 		if (!$query->EOF) {
- 			if ($col_name != '') {
- 				$column = $query->fields[$col_name];
-@@ -184,7 +184,7 @@
- 	$db_conn->SetFetchMode(ADODB_FETCH_ASSOC);
- 	$query = $db_conn->Execute($sql);
- 
--	if (($query) || ($db_conn->ErrorNo() == 1032)) {
-+	if (($db_conn->ErrorNo() == 0) || ($db_conn->ErrorNo() == 1032)) {
- 		if (!$query->EOF) {
- 			$fields = $query->fields;
- 
-@@ -222,7 +222,7 @@
- 	$db_conn->SetFetchMode(ADODB_FETCH_ASSOC);
- 	$query = $db_conn->Execute($sql);
- 
--	if (($query) || ($db_conn->ErrorNo() == 1032)) {
-+	if (($db_conn->ErrorNo() == 0) || ($db_conn->ErrorNo() == 1032)) {
- 		while ((!$query->EOF) && ($query)) {
- 			$data{sizeof($data)} = $query->fields;
- 			$query->MoveNext();
-diff -ruBbd cacti-0.8.7g/poller.php cacti-0.8.7g-patched/poller.php
---- cacti-0.8.7g/poller.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/poller.php	2010-08-31 20:31:22.000000000 -0400
-@@ -109,7 +109,7 @@
- }
- 
- /* record the start time */
--list($micro,$seconds) = split(" ", microtime());
-+list($micro,$seconds) = explode(" ", microtime());
- $poller_start         = $seconds + $micro;
- $overhead_time = 0;
- 
-@@ -140,7 +140,7 @@
- 							WHERE rrd_next_step<=0
- 							GROUP BY host_id
- 							ORDER BY host_id"), "host_id", "data_sources");
--	$poller_runs       = $cron_interval / $poller_interval;
-+	$poller_runs       = intval($cron_interval / $poller_interval);
- 
- 	define("MAX_POLLER_RUNTIME", $poller_runs * $poller_interval - 2);
- }else{
-@@ -211,10 +211,11 @@
- 
- $poller_runs_completed = 0;
- $poller_items_total    = 0;
-+$polling_hosts         = array_merge(array(0 => array("id" => "0")), db_fetch_assoc("SELECT id FROM host WHERE disabled='' ORDER BY id"));
- 
- while ($poller_runs_completed < $poller_runs) {
- 	/* record the start time for this loop */
--	list($micro,$seconds) = split(" ", microtime());
-+	list($micro,$seconds) = explode(" ", microtime());
- 	$loop_start = $seconds + $micro;
- 
- 	/* calculate overhead time */
-@@ -222,8 +223,6 @@
- 		$overhead_time = $loop_start - $poller_start;
- 	}
- 
--	$polling_hosts = array_merge(array(0 => array("id" => "0")), db_fetch_assoc("SELECT id FROM host WHERE disabled = '' ORDER BY id"));
--
- 	/* initialize counters for script file handling */
- 	$host_count = 1;
- 
-@@ -375,7 +374,7 @@
- 
- 				break;
- 			}else {
--				if (read_config_option("log_verbosity") >= POLLER_VERBOSITY_MEDIUM) {
-+				if (read_config_option("log_verbosity") >= POLLER_VERBOSITY_MEDIUM || $debug) {
- 					print "Waiting on " . ($started_processes - $finished_processes) . " of " . $started_processes . " pollers.\n";
- 				}
- 
-@@ -390,7 +389,7 @@
- 
- 					break;
- 				}else{
--					sleep(1);
-+					usleep(500);
- 				}
- 			}
- 		}
-@@ -427,28 +426,27 @@
- 	$poller_runs_completed++;
- 
- 	/* record the start time for this loop */
--	list($micro,$seconds) = split(" ", microtime());
-+	list($micro,$seconds) = explode(" ", microtime());
- 	$loop_end = $seconds + $micro;
-+	$loop_time = $loop_end - $loop_start;
- 
--	if (($loop_end - $loop_start) < $poller_interval) {
-+	if ($loop_time < $poller_interval) {
- 		if ($poller_runs_completed == 1) {
--			$sleep_time = ($poller_interval - ($loop_end - $loop_start) - $overhead_time);
--		}else{
--			$sleep_time = ($poller_interval -  ($loop_end - $loop_start));
-+			$sleep_time = $poller_interval - $loop_time - $overhead_time;
-+		} else {
-+			$sleep_time = $poller_interval - $loop_time;
- 		}
- 
- 		/* log some nice debug information */
--		if (read_config_option('log_verbosity') >= POLLER_VERBOSITY_DEBUG) {
--			echo "Loop  Time is: " . ($loop_end - $loop_start) . "\n";
--			echo "Sleep Time is: " . $sleep_time . "\n";
--			echo "Total Time is: " . ($loop_end - $poller_start) . "\n";
-+		if (read_config_option('log_verbosity') >= POLLER_VERBOSITY_DEBUG || $debug) {
-+			echo "Loop  Time is: " . round($loop_time, 2) . "\n";
-+			echo "Sleep Time is: " . round($sleep_time, 2) . "\n";
-+			echo "Total Time is: " . round($loop_end - $poller_start, 2) . "\n";
-  		}
- 
- 		/* sleep the appripriate amount of time */
- 		if ($poller_runs_completed < $poller_runs) {
--			db_close();
- 			usleep($sleep_time * 1000000);
--			db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
- 		}
- 	}else if (read_config_option('log_verbosity') >= POLLER_VERBOSITY_MEDIUM || $debug) {
- 		cacti_log("WARNING: Cacti Polling Cycle Exceeded Poller Interval by " . $loop_end-$loop_start-$poller_interval . " seconds", TRUE, "POLLER");
-@@ -459,7 +457,7 @@
- 	$hosts_per_process, $num_polling_items, $rrds_processed) {
- 
- 	/* take time and log performance data */
--	list($micro,$seconds) = split(" ", microtime());
-+	list($micro,$seconds) = explode(" ", microtime());
- 	$loop_end = $seconds + $micro;
- 
- 	$cacti_stats = sprintf(
-
diff --git a/script_server_command_line_parse.patch b/script_server_command_line_parse.patch
deleted file mode 100644
index 8cddf18..0000000
--- a/script_server_command_line_parse.patch
+++ /dev/null
@@ -1,136 +0,0 @@
---- cacti-0.8.7g/script_server.php	2010-07-09 18:33:46.000000000 -0400
-+++ cacti-0.8.7g-patched/script_server.php	2010-07-27 21:30:31.000000000 -0400
-@@ -72,7 +72,7 @@
- }
- 
- /* record the script start time */
--list($micro,$seconds) = split(" ", microtime());
-+list($micro,$seconds) = explode(" ", microtime());
- $start = $seconds + $micro;
- 
- /* some debugging */
-@@ -171,7 +171,11 @@
- 
- 				if (isset($command_array[2])) {
- 					$parameters = trim($command_array[2]);
--					$parameter_array = explode(" ", trim($command_array[2]));
-+					$parameter_array = array();
-+					if (!parseArgs($parameters, $parameter_array)) {
-+						cacti_log("WARNING: Script Server count not parse '$parameters' for $function", false, "PHPSVR");
-+						return "U";
-+					}
- 				}else{
- 					$parameters = "";
- 					$parameters_array = array();
-@@ -236,3 +240,111 @@
- 		exit (-1);
- 	}
- }
-+
-+function parseArgs($string, &$str_list, $debug = false) {
-+	$delimiters = array("'",'"');
-+	$delimited  = false;
-+	$str_list   = array();
-+
-+	if ($debug) echo "String: '" . $string . "'\n";
-+
-+	foreach($delimiters as $delimiter) {
-+		if (strpos($string, $delimiter) !== false) {
-+			$delimited = true;
-+			break;
-+		}
-+	}
-+
-+	/* process the simple case */
-+	if (!$delimited) {
-+		$str_list = explode(" ", $string);
-+
-+		if ($debug) echo "Output: '" . implode(",", $str_list) . "'\n";
-+
-+		return true;
-+	}
-+
-+	/* Break str down into an array of characters and process */
-+	$char_array = str_split($string);
-+	$escaping = false;
-+	$indelim  = false;
-+	$parse_ok = true;
-+	$curstr   = '';
-+	foreach($char_array as $char) {
-+		switch ($char) {
-+		case '\'':
-+		case '"':
-+			if (!$indelim) {
-+				if (!$escaping) {
-+					$indelim = true;
-+				}else{
-+					$curstr .= $char;
-+					$escaping = false;
-+				}
-+			}elseif (!$escaping) {
-+				$str_list[] = $curstr;
-+				$curstr     = '';
-+				$indelim    = false;
-+			}elseif ($escaping) {
-+				$curstr  .= $char;
-+				$escaping = false;
-+			}
-+
-+			break;
-+		case '\\':
-+			if ($escaping) {
-+				$curstr  .= $char;
-+				$escaping = false;
-+			}else{
-+				$escaping = true;
-+			}
-+
-+			break;
-+		case ' ':
-+			if ($escaping) {
-+				$parse_ok = false;
-+				$msg = 'Parse error attempting to parse string';
-+			}elseif ($indelim) {
-+				$curstr .= $char;
-+			}elseif (strlen($curstr)) {
-+				$str_list[] = $curstr;
-+				$curstr = '';
-+			}
-+
-+			break;
-+		case '`':
-+			$parse_ok = false;
-+			$msg   = 'Backtic (`) characters not allowed';
-+
-+			break;
-+		default:
-+			if ($escaping) {
-+				$parse_ok = false;
-+				$msg   = 'Parse error attempting to parse string';
-+			}else{
-+				$curstr .= $char;
-+			}
-+			break;
-+		}
-+
-+		if (!$parse_ok) {
-+			break;
-+		}
-+	}
-+
-+	/* Add the last str to the string array */
-+	if ($indelim || $escaping) {
-+		$parse_ok = false;
-+		$msg = 'Parse error attempting to parse string';
-+	}
-+
-+	if (!$parse_ok) {
-+		echo "ERROR: " . $msg . " '" . $string . "'\n";
-+	}else{
-+		$str_list[] = $curstr;
-+	}
-+
-+	if ($debug) echo "Output: '" . implode(",", $str_list) . "'\n";
-+
-+	return $parse_ok;
-+}
diff --git a/snmp_invalid_response.patch b/snmp_invalid_response.patch
deleted file mode 100644
index 5b2dd20..0000000
--- a/snmp_invalid_response.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- ../tags/0.8.7e/include/global_arrays.php	2009-06-28 12:34:31.000000000 -0400
-+++ 0.8.7/include/global_arrays.php	2009-08-18 20:04:44.000000000 -0400
-@@ -174,6 +174,10 @@
- 	"DES" => "DES (default)",
- 	"AES128" => "AES");
- 
-+$banned_snmp_strings = array(
-+	"End of MIB",
-+	"No Such");
-+
- $logfile_options = array(1 =>
- 	"Logfile Only",
- 	"Logfile and Syslog/Eventlog",
---- ../tags/0.8.7e/lib/snmp.php	2009-06-28 12:34:30.000000000 -0400
-+++ 0.8.7/lib/snmp.php	2009-08-18 20:04:44.000000000 -0400
-@@ -27,9 +27,6 @@
- define("SNMP_METHOD_PHP", 1);
- define("SNMP_METHOD_BINARY", 2);
- 
--/* declare once, use many times */
--$banned_snmp_strings = array("End of MIB", "No Such");
--
- /* we must use an apostrophe to escape community names under Unix in case the user uses
- characters that the shell might interpret. the ucd-snmp binaries on Windows flip out when
- you do this, but are perfectly happy with a quotation mark. */
diff --git a/sql_injection_template_export.patch b/sql_injection_template_export.patch
deleted file mode 100644
index 397990c..0000000
--- a/sql_injection_template_export.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- cacti-0.8.7e/templates_export.php	2009-06-28 12:07:11.000000000 -0400
-+++ cacti-fixed/templates_export.php	2010-04-17 14:08:42.000000000 -0400
-@@ -49,6 +49,10 @@
- function form_save() {
- 	global $export_types;
- 
-+    /* ================= input validation ================= */
-+    input_validate_input_number(get_request_var_post("export_item_id"));
-+    /* ==================================================== */
-+
- 	if (isset($_POST["save_component_export"])) {
- 		$xml_data = get_item_xml($_POST["export_type"], $_POST["export_item_id"], (((isset($_POST["include_deps"]) ? $_POST["include_deps"] : "") == "") ? false : true));
- 
diff --git a/template_duplication.patch b/template_duplication.patch
deleted file mode 100644
index 5c23972..0000000
--- a/template_duplication.patch
+++ /dev/null
@@ -1,232 +0,0 @@
-diff -ruBbd 0.8.7e/cli/repair_templates.php 0.8.7/cli/repair_templates.php
---- 0.8.7e/cli/repair_templates.php	2009-08-18 22:03:22.000000000 -0400
-+++ 0.8.7/cli/repair_templates.php	2009-08-20 07:43:54.000000000 -0400
-@@ -0,0 +1,136 @@
-+<?php
-+/*
-+ +-------------------------------------------------------------------------+
-+ | Copyright (C) 2004-2009 The Cacti Group                                 |
-+ |                                                                         |
-+ | This program is free software; you can redistribute it and/or           |
-+ | modify it under the terms of the GNU General Public License             |
-+ | as published by the Free Software Foundation; either version 2          |
-+ | of the License, or (at your option) any later version.                  |
-+ |                                                                         |
-+ | This program is distributed in the hope that it will be useful,         |
-+ | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
-+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
-+ | GNU General Public License for more details.                            |
-+ +-------------------------------------------------------------------------+
-+ | Cacti: The Complete RRDTool-based Graphing Solution                     |
-+ +-------------------------------------------------------------------------+
-+ | This code is designed, written, and maintained by the Cacti Group. See  |
-+ | about.php and/or the AUTHORS file for specific developer information.   |
-+ +-------------------------------------------------------------------------+
-+ | http://www.cacti.net/                                                   |
-+ +-------------------------------------------------------------------------+
-+*/
-+
-+/* do NOT run this script through a web browser */
-+if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
-+	die("<br><strong>This script is only meant to run at the command line.</strong>");
-+}
-+
-+$no_http_headers = true;
-+
-+include(dirname(__FILE__) . "/../include/global.php");
-+include_once("../lib/utility.php");
-+include_once("../lib/template.php");
-+
-+/* process calling arguments */
-+$parms = $_SERVER["argv"];
-+array_shift($parms);
-+
-+$execute = FALSE;
-+
-+foreach($parms as $parameter) {
-+	@list($arg, $value) = @explode("=", $parameter);
-+
-+	switch ($arg) {
-+	case "--execute":
-+		$execute = TRUE;
-+		break;
-+	case "-h":
-+	case "-v":
-+	case "-V":
-+	case "--version":
-+	case "--help":
-+		display_help();
-+		exit;
-+	default:
-+		print "ERROR: Invalid Parameter " . $parameter . "\n\n";
-+		display_help();
-+		exit;
-+	}
-+}
-+
-+if ($execute) {
-+	echo "NOTE: Repairing All Duplicated Templates\n";
-+} else {
-+	echo "NOTE: Performing Check of Templates\n";
-+}
-+
-+/* repair data templates first */
-+if ($execute) {
-+	echo "NOTE: Repairing Data Templates\n";
-+} else {
-+	echo "NOTE: Performing Check of Data Templates\n";
-+}
-+
-+$damaged_template_ids = db_fetch_assoc("SELECT DISTINCT data_template_id FROM data_template_rrd WHERE hash='' AND local_data_id=0");
-+if (sizeof($damaged_template_ids)) {
-+	foreach($damaged_template_ids as $id) {
-+		$template_name = db_fetch_cell("SELECT name FROM data_template WHERE id=" . $id["data_template_id"]);
-+		echo "NOTE: Data Template '$template_name' is Damaged and can be repaired\n";
-+	}
-+
-+	$damaged_templates = db_fetch_assoc("SELECT * FROM data_template_rrd WHERE hash='' AND local_data_id=0");
-+	if (sizeof($damaged_templates)) {
-+		echo "NOTE: -- Damaged Data Templates Objects Found is '" . sizeof($damaged_templates) . "'\n";
-+		if ($execute) {
-+			foreach($damaged_templates as $template) {
-+				$hash = get_hash_data_template($template["local_data_template_rrd_id"], "data_template_item");
-+				db_execute("UPDATE data_template_rrd SET hash='$hash' WHERE id=" . $template["id"]);
-+			}
-+		}
-+	}
-+} else {
-+	echo "NOTE: No Damaged Data Templates Found\n";
-+}
-+
-+/* reset the array */
-+$damaged_templates = array();
-+
-+/* repair graph templates */
-+if ($execute) {
-+	echo "NOTE: Repairing Graph Templates\n";
-+} else {
-+	echo "NOTE: Performing Check of Graph Templates\n";
-+}
-+
-+$damaged_template_ids = db_fetch_assoc("SELECT DISTINCT graph_template_id FROM graph_template_input WHERE hash=''");
-+if (sizeof($damaged_template_ids)) {
-+	foreach($damaged_template_ids as $id) {
-+		$template_name = db_fetch_cell("SELECT name FROM graph_templates WHERE id=" . $id["graph_template_id"]);
-+		echo "NOTE: Graph Template '$template_name' is Damaged and can be repaired\n";
-+	}
-+
-+	$damaged_templates = db_fetch_assoc("SELECT * FROM graph_template_input WHERE hash=''");
-+	if (sizeof($damaged_templates)) {
-+		echo "NOTE: -- Damaged Graph Templates Objects Found is '" . sizeof($damaged_templates) . "'\n";
-+		if ($execute) {
-+			foreach($damaged_templates as $template) {
-+				$hash = get_hash_graph_template(0, "graph_template_input");
-+				db_execute("UPDATE graph_template_input SET hash='$hash' WHERE id=" . $template["id"]);
-+			}
-+		}
-+	}
-+} else {
-+	echo "NOTE: No Damaged Graph Templates Found\n";
-+}
-+
-+
-+/* display_help - displays the usage of the function */
-+function display_help () {
-+	print "Cacti Database Template Repair Tool v1.0, Copyright 2004-2009 - The Cacti Group\n\n";
-+	print "usage: repair_templates.php --execute [--help]\n\n";
-+	print "--execute        - Perform the repair\n";
-+	print "--help           - display this help message\n";
-+}
-+?>
-diff -ruBbd 0.8.7e/docs/README 0.8.7/docs/README
---- 0.8.7e/docs/README	2009-08-18 21:57:30.000000000 -0400
-+++ 0.8.7/docs/README	2009-08-18 21:58:09.000000000 -0400
-@@ -90,6 +90,9 @@
-                             table
-   poller_reindex_hosts.php - Cause data query reindex on hosts
-   rebuild_poller_cache.php - Rebuilds the poller cache
-+  repair_templates.php     - Certain templates, when created using the "duplicate"
-+      function in Cacti, do not import/export well.  This utility repairs 
-+      those templates.
- 
- 
- 
---- 0.8.7e/lib/export.php	2009-08-18 21:56:47.000000000 -0400
-+++ 0.8.7/lib/export.php	2009-08-18 21:57:50.000000000 -0400
-@@ -811,7 +811,9 @@
- }
- 
- function xml_character_encode($text) {
--
-+	if (function_exists("htmlspecialchars")) {
-+		return htmlspecialchars($text, ENT_QUOTES, "UTF-8");
-+	} else {
- 	$text = str_replace("&", "&", $text);
- 	$text = str_replace(">", ">", $text);
- 	$text = str_replace("<", "<", $text);
-@@ -819,6 +821,7 @@
- 	$text = str_replace("\'", "'", $text);
- 
- 	return $text;
-+	}
- }
- 
- ?>
---- 0.8.7e/lib/import.php	2009-08-18 21:56:59.000000000 -0400
-+++ 0.8.7/lib/import.php	2009-08-18 21:57:55.000000000 -0400
-@@ -36,10 +36,6 @@
- 		return $info_array;
- 	}
- 
--	if (isset($xml_array["name"])) {
--		$xml_array["name"] = htmlspecialchars($xml_array["name"]);
--	}
--
- 	while (list($hash, $hash_array) = each($xml_array)) {
- 		/* parse information from the hash */
- 		$parsed_hash = parse_xml_hash($hash);
-@@ -115,7 +111,7 @@
- 	$_graph_template_id = db_fetch_cell("select id from graph_templates where hash='$hash'");
- 	$save["id"] = (empty($_graph_template_id) ? "0" : $_graph_template_id);
- 	$save["hash"] = $hash;
--	$save["name"] = htmlspecialchars($xml_array["name"]);
-+	$save["name"] = $xml_array["name"];
- 	$graph_template_id = sql_save($save, "graph_templates");
- 
- 	$hash_cache["graph_template"][$hash] = $graph_template_id;
-@@ -914,9 +910,13 @@
- }
- 
- function xml_character_decode($text) {
-+	if (function_exists("html_entity_decode")) {
-+		return html_entity_decode($text, ENT_QUOTES, "UTF-8");
-+	} else {
- 	$trans_tbl = get_html_translation_table(HTML_ENTITIES);
- 	$trans_tbl = array_flip($trans_tbl);
- 	return strtr($text, $trans_tbl);
-+	}
- }
- 
- ?>
---- 0.8.7e/lib/utility.php	2009-08-18 21:57:08.000000000 -0400
-+++ 0.8.7/lib/utility.php	2009-08-18 21:58:00.000000000 -0400
-@@ -346,6 +346,7 @@
- 			$save["name"] = $graph_template_input["name"];
- 			$save["description"] = $graph_template_input["description"];
- 			$save["column_name"] = $graph_template_input["column_name"];
-+			$save["hash"]              = get_hash_graph_template(0, "graph_template_input");
- 
- 			$graph_template_input_id = sql_save($save, "graph_template_input");
- 
-@@ -436,6 +437,11 @@
- 		$save["local_data_id"] = (isset($local_data_id) ? $local_data_id : 0);
- 		$save["local_data_template_rrd_id"] = (isset($data_template_rrd["local_data_template_rrd_id"]) ? $data_template_rrd["local_data_template_rrd_id"] : 0);
- 		$save["data_template_id"] = (!empty($_local_data_id) ? $data_template_rrd["data_template_id"] : $data_template_id);
-+		if ($save["local_data_id"] == 0) {
-+			$save["hash"]                   = get_hash_data_template($data_template_rrd["local_data_template_rrd_id"], "data_template_item");
-+		} else {
-+			$save["hash"] = '';
-+		}
- 
- 		while (list($field, $array) = each($struct_data_source_item)) {
- 			$save{$field} = $data_template_rrd{$field};
diff --git a/unified_issues.patch b/unified_issues.patch
deleted file mode 100644
index d24cdaa..0000000
--- a/unified_issues.patch
+++ /dev/null
@@ -1,348 +0,0 @@
-diff -ruBbd cacti-spine-0.8.7g.old/ChangeLog cacti-spine-0.8.7g/ChangeLog
---- cacti-spine-0.8.7g.old/ChangeLog	2010-07-09 19:25:56.000000000 -0400
-+++ cacti-spine-0.8.7g/ChangeLog	2010-08-31 20:21:22.000000000 -0400
-@@ -1,5 +1,13 @@
- The Cacti Group | spine
- 
-+Patched 0.8.7g
-+-bug#0001669: Problems with getting data from script using SPINE on Windows Server 2003 x32 
-+-bug#0001829: Wrong string numerical value got from Spine SNMP poller 
-+-bug: Net-snmp API issues cause spine crashes with some SNMP agents
-+-bug: Host list not properly initialized
-+-bug: Mutex locking issues cause deadlocks in Windows
-+-bug: Escape windows type back slashes in scripts
-+
- 0.8.7g
- -feature: Multi threaded host polling
- 
-diff -ruBbd cacti-spine-0.8.7g.old/poller.c cacti-spine-0.8.7g/poller.c
---- cacti-spine-0.8.7g.old/poller.c	2010-07-09 17:39:53.000000000 -0400
-+++ cacti-spine-0.8.7g/poller.c	2010-08-31 20:18:58.000000000 -0400
-@@ -57,21 +57,26 @@
- 	host_data_ids    = poller_details.host_data_ids;
- 	snprintf(host_time, SMALL_BUFSIZE, "%s", poller_details.host_time);
- 
--	thread_mutex_unlock(LOCK_THREAD);
--
- 	free(arg);
- 
-+	thread_ready = TRUE;
-+
- 	SPINE_LOG_DEBUG(("DEBUG: In Poller, About to Start Polling of Host"));
- 
- 	poll_host(host_id, host_thread, last_host_thread, host_data_ids, host_time);
- 
--	thread_mutex_lock(LOCK_THREAD);
--
-+	while (TRUE) {
-+		if (thread_mutex_trylock(LOCK_THREAD) == 0) {
- 	active_threads--;
-+			thread_mutex_unlock(LOCK_THREAD);
- 
--	SPINE_LOG_DEBUG(("DEBUG: The Value of Active Threads is %i" ,active_threads));
-+			break;
-+		}
- 
--	thread_mutex_unlock(LOCK_THREAD);
-+		usleep(100);
-+	}
-+
-+	SPINE_LOG_DEBUG(("DEBUG: The Value of Active Threads is %i" ,active_threads));
- 
- 	/* end the thread */
- 	pthread_exit(0);
-@@ -965,7 +970,7 @@
- 				poll_result = exec_poll(host, poller_items[i].arg1);
- 
- 				/* process the result */
--				if ((is_numeric(poll_result)) || (is_multipart_output(poll_result))) {
-+				if ((is_numeric(poll_result)) || (is_multipart_output(trim(poll_result)))) {
- 					snprintf(poller_items[i].result, RESULTS_BUFFER, "%s", poll_result);
- 				}else if (is_hexadecimal(snmp_oids[j].result, TRUE)) {
- 					snprintf(poller_items[i].result, RESULTS_BUFFER, "%lld", hex2dec(poll_result));
-@@ -998,7 +1003,7 @@
- 				poll_result = php_cmd(poller_items[i].arg1, php_process);
- 
- 				/* process the output */
--				if ((is_numeric(poll_result)) || (is_multipart_output(poll_result))) {
-+				if ((is_numeric(poll_result)) || (is_multipart_output(trim(poll_result)))) {
- 					snprintf(poller_items[i].result, RESULTS_BUFFER, "%s", poll_result);
- 				}else if (is_hexadecimal(snmp_oids[j].result, TRUE)) {
- 					snprintf(poller_items[i].result, RESULTS_BUFFER, "%lld", hex2dec(poll_result));
-@@ -1247,7 +1252,7 @@
- 		if (is_numeric(result)) {
- 			return TRUE;
- 		}else{
--			if (is_multipart_output(result)) {
-+			if (is_multipart_output(trim(result))) {
- 				return TRUE;
- 			}else{
- 				return FALSE;
-@@ -1290,7 +1295,7 @@
- 
- 	/* compensate for back slashes in arguments */
- 	#if defined(__CYGWIN__)
--	proc_command = add_slashes(command, 2);
-+	proc_command = add_slashes(command);
- 	#else
- 	proc_command = command;
- 	#endif
-@@ -1340,7 +1345,7 @@
- 		FD_SET(cmd_fd, &fds);
- 
- 		/* wait x seonds for pipe response */
--		switch (select(cmd_fd+1, &fds, NULL, NULL, &timeout)) {
-+		switch (select(FD_SETSIZE, &fds, NULL, NULL, &timeout)) {
- 		case -1:
- 			switch (errno) {
- 			case EBADF:
-@@ -1381,11 +1386,13 @@
- 				break;
- 			}
- 		case 0:
-+			#ifdef USING_TPOPEN
- 			SPINE_LOG(("Host[%i] ERROR: The POPEN timed out", current_host->id));
- 
--			#ifdef USING_TPOPEN
- 			close_fd = FALSE;
- 			#else
-+			SPINE_LOG(("Host[%i] ERROR: The NIFTY POPEN timed out", current_host->id));
-+
- 			pid = nft_pchild(cmd_fd);
- 			kill(pid, SIGKILL);
- 			#endif
-diff -ruBbd cacti-spine-0.8.7g.old/snmp.c cacti-spine-0.8.7g/snmp.c
---- cacti-spine-0.8.7g.old/snmp.c	2010-07-09 17:39:53.000000000 -0400
-+++ cacti-spine-0.8.7g/snmp.c	2010-08-31 20:18:58.000000000 -0400
-@@ -499,13 +499,9 @@
- 	size_t out_len = 0;
- 
- 	if ((buf = (u_char *) calloc(buf_len, 1)) != 0) {
--		if (sprint_realloc_value(&buf, &buf_len, &out_len, 1,
--				objid, objidlen, variable)) {
-+		sprint_realloc_by_type(&buf, &buf_len, &out_len, 1, variable, NULL, NULL, NULL);
- 			snprintf(obuf, buf_len, "%s", buf);
- 		}else{
--			snprintf(obuf, buf_len, "%s [TRUNCATED]", buf);
--		}
--	}else{
- 		SET_UNDEFINED(obuf);
- 	}
- 
-@@ -528,6 +524,7 @@
- 	int i;
- 	int array_count;
- 	int index_count;
-+	char   temp_result[RESULTS_BUFFER];
- 
- 	struct nameStruct {
- 	    oid             name[MAX_OID_LEN];
-@@ -570,11 +567,13 @@
- 				for(i = 0; i < num_oids && vars; i++) {
- 					if (!IS_UNDEFINED(snmp_oids[i].result)) {
- 						#ifdef USE_NET_SNMP
--						snmp_snprint_value(snmp_oids[i].result, RESULTS_BUFFER, vars->name, vars->name_length, vars);
-+						snmp_snprint_value(temp_result, RESULTS_BUFFER, vars->name, vars->name_length, vars);
- 						#else
--						sprint_value(snmp_oids[i].result, vars->name, vars->name_length, vars);
-+						sprint_value(temp_result, vars->name, vars->name_length, vars);
- 						#endif
- 						
-+						snprintf(snmp_oids[i].result, RESULTS_BUFFER, "%s", trim(temp_result));
-+						
- 						vars = vars->next_variable;
- 					}
- 				}
-diff -ruBbd cacti-spine-0.8.7g.old/spine.c cacti-spine-0.8.7g/spine.c
---- cacti-spine-0.8.7g.old/spine.c	2010-07-09 17:39:53.000000000 -0400
-+++ cacti-spine-0.8.7g/spine.c	2010-08-31 20:18:58.000000000 -0400
-@@ -94,6 +94,7 @@
- int num_hosts = 0;
- int active_threads = 0;
- int active_scripts = 0;
-+int thread_ready   = FALSE;
- 
- config_t set;
- php_t	*php_processes = 0;
-@@ -134,7 +135,7 @@
- 	int poller_counter = 0;
- 	int last_active_threads = 0;
- 	int valid_conf_file = FALSE;
--	long int EXTERNAL_THREAD_SLEEP = 5000;
-+	long int EXTERNAL_THREAD_SLEEP = 50;
- 	long int internal_thread_sleep;
- 	char querybuf[BIG_BUFSIZE], *qp = querybuf;
- 	char *host_time = NULL;
-@@ -196,6 +197,7 @@
- 
- 	/* we attempt to support scripts better in cygwin */
- 	#if defined(__CYGWIN__)
-+	setenv("CYGWIN", "nodosfilewarning", 1);
- 	if (file_exists("./sh.exe")) {
- 		set.cygwinshloc = 0;
- 		printf("NOTE: The Shell Command Exists in the current directory\n");
-@@ -281,7 +283,7 @@
- 
- 		else if (STRMATCH(arg, "-H") ||
- 				 STRIMATCH(arg, "--hostlist")) {
--			snprintf(set.host_id_list, BIG_BUFSIZE, getarg(opt, &argv));
-+			snprintf(set.host_id_list, BIG_BUFSIZE, "%s", getarg(opt, &argv));
- 		}
- 
- 		else if (STRMATCH(arg, "-h") ||
-@@ -584,6 +586,11 @@
- 				poller_details->host_data_ids    = itemsPT;
- 				poller_details->host_time        = host_time;
- 
-+				/* this variable tells us that the child had loaded the poller
-+				 * poller_details structure and we can move on to the next thread
-+				 */
-+				thread_ready = FALSE;
-+
- 				/* create child process */
- 				thread_status = pthread_create(&threads[device_counter], &attr, child, poller_details);
- 
-@@ -596,6 +603,11 @@
- 						}
- 						active_threads++;
- 
-+						/* wait for the child to read and process the structure */
-+						while (!thread_ready) { 
-+							usleep(internal_thread_sleep);
-+						}
-+
- 						SPINE_LOG_DEBUG(("DEBUG: The Value of Active Threads is %i", active_threads));
- 
- 						break;
-@@ -603,7 +615,7 @@
- 						SPINE_LOG(("ERROR: The System Lacked the Resources to Create a Thread"));
- 						break;
- 					case EFAULT:
--						SPINE_LOG(("ERROR: The Thread or Attribute Was Invalid"));
-+						SPINE_LOG(("ERROR: The Thread or Attribute were Invalid"));
- 						break;
- 					case EINVAL:
- 						SPINE_LOG(("ERROR: The Thread Attribute is Not Initialized"));
-@@ -613,6 +625,8 @@
- 						break;
- 				}
- 
-+				thread_mutex_unlock(LOCK_THREAD);
-+
- 				/* get current time and exit program if time limit exceeded */
- 				if (poller_counter >= 20) {
- 					current_time = get_time_as_double();
-diff -ruBbd cacti-spine-0.8.7g.old/spine.h cacti-spine-0.8.7g/spine.h
---- cacti-spine-0.8.7g.old/spine.h	2010-07-09 17:39:53.000000000 -0400
-+++ cacti-spine-0.8.7g/spine.h	2010-08-31 20:18:58.000000000 -0400
-@@ -504,5 +504,6 @@
- extern char   start_datetime[20];
- extern char   config_paths[CONFIG_PATHS][BUFSIZE];
- extern int    active_threads;
-+extern int    thread_ready;
- 
- #endif /* not _SPINE_H_ */
-diff -ruBbd cacti-spine-0.8.7g.old/util.c cacti-spine-0.8.7g/util.c
---- cacti-spine-0.8.7g.old/util.c	2010-07-09 17:39:53.000000000 -0400
-+++ cacti-spine-0.8.7g/util.c	2010-08-31 20:18:58.000000000 -0400
-@@ -755,7 +755,7 @@
- 	/* empty string is not all digits */
- 	if ( *string == '\0' ) return FALSE;
- 
--	while ( isdigit(*string) )
-+	while ( isdigit((int)*string) )
- 		string++;
- 
- 	return *string == '\0';
-@@ -773,7 +773,7 @@
-  */
- int is_ipaddress(const char *string) {
- 	while (*string) {
--		if ((isdigit(*string)) ||
-+		if ((isdigit((int)*string)) ||
- 			(*string == '.') ||
- 			(*string == ':')) {
- 			string++;
-@@ -887,7 +887,7 @@
- 	i = strlen(string);
- 
- 	while (i >= 0) {
--		if (isdigit(string[i])) {
-+		if (isdigit((int)string[i])) {
- 			break;
- 		}else{
- 			string[i] = '\0';
-@@ -898,17 +898,15 @@
- 	return string;
- }
- 
--/*! \fn char *add_slashes(char *string, int arguments_2_strip)
-- *  \brief change all backslashes to forward slashes for the first n arguements.
-+/*! \fn char *add_slashes(char *string)
-+ *  \brief add escaping to back slashes on for Windows type commands.
-  *  \param string the string to replace slashes
-- *  \param arguments_2_strip the number of space delimited arguments to reverse
-  *
-  *  \return a pointer to the modified string. Variable must be freed by parent.
-  *
-  */
--char *add_slashes(char *string, int arguments_2_strip) {
-+char *add_slashes(char *string) {
- 	int length;
--	int space_count;
- 	int position;
- 	int new_position;
- 	char *return_str;
-@@ -919,9 +917,8 @@
- 	return_str[0] = '\0';
- 
- 	length = strlen(string);
--	space_count = 0;
- 	position = 0;
--	new_position = position;
-+	new_position = 0;
- 
- 	/* simply return on blank string */
- 	if (!length) {
-@@ -931,17 +928,9 @@
- 	while (position < length) {
- 		/* backslash detected, change to forward slash */
- 		if (string[position] == '\\') {
--			/* only add slashes for first x arguments */
--			if (space_count < arguments_2_strip) {
--				return_str[new_position] = '/';
--			}else{
--				return_str[new_position] = string[position];
--			}
--		/* end of argument detected */
--		}else if (string[position] == ' ') {
--			return_str[new_position] = ' ';
--			space_count++;
--		/* normal character detected */
-+			return_str[new_position] = '\\';
-+			new_position++;
-+			return_str[new_position] = '\\';
- 		}else{
- 			return_str[new_position] = string[position];
- 		}
-@@ -1248,7 +1237,7 @@
- 	seteuid(0);
- 
- 	if (geteuid() != 0) {
--		SPINE_LOG_DEBUG(("WARNING: Spine NOT running asroot.  This is require if using ICMP.  Please run \"chmod +s;chown root:root spine\" to resolve."));
-+		SPINE_LOG_DEBUG(("WARNING: Spine NOT running asroot.  This is required if using ICMP.  Please run \"chmod +s;chown root:root spine\" to resolve."));
- 		set.icmp_avail = FALSE;
- 	}else{
- 		SPINE_LOG_DEBUG(("DEBUG: Spine is running asroot."));
-diff -ruBbd cacti-spine-0.8.7g.old/util.h cacti-spine-0.8.7g/util.h
---- cacti-spine-0.8.7g.old/util.h	2010-07-09 17:39:53.000000000 -0400
-+++ cacti-spine-0.8.7g/util.h	2010-08-31 20:18:58.000000000 -0400
-@@ -54,7 +54,7 @@
- extern int is_hexadecimal(const char * str, const short ignore_space);
- 
- /* string and file functions */
--extern char *add_slashes(char *string, int arguments_2_strip);
-+extern char *add_slashes(char *string);
- extern int file_exists(const char *filename);
- extern char *strip_alpha(char *string);
- extern char *strncopy(char *dst, const char *src, size_t n);
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list