]> git.pld-linux.org Git - packages/cacti.git/blob - cacti-config.patch
- up to 1.2.9; fixes CVE-2020-7106, CVE-2020-7237
[packages/cacti.git] / cacti-config.patch
1 --- cacti-0.8.7b/include/global.php     2008-10-05 04:38:29.740276226 +0300
2 +++ cacti-0.8.7g/include/global.php     2010-12-13 12:10:44.312310245 +0200
3 @@ -83,13 +83,7 @@ $disable_log_rotation = false;
4  ini_set('max_input_vars', '5000');
5  $config = array();
6  
7 -/* Include configuration, or use the defaults */
8 -if (file_exists(dirname(__FILE__) . '/config.php')) {
9 -       if (!is_readable(dirname(__FILE__) . '/config.php')) {
10 -               die('Configuration file include/config.php is present, but unreadable.' . PHP_EOL);
11 -       }
12 -       include(dirname(__FILE__) . '/config.php');
13 -}
14 +require '/etc/webapps/cacti/config.php';
15  
16  if (isset($config['cacti_version'])) {
17         die('Invalid include/config.php file detected.' . PHP_EOL);
18 @@ -139,7 +139,8 @@ if ($config['cacti_server_os'] == 'win32
19         $config['library_path'] = preg_replace("/(.*[\/])include/", "\\1lib", dirname(__FILE__));
20  }
21  $config['include_path'] = dirname(__FILE__);
22 -$config['rra_path'] = $config['base_path'] . '/rra';
23 +$config["rra_path"] = '/var/lib/cacti/rra';
24 +$config["path_cactilog"] = '/var/log/cacti/cacti.log';
25  
26  /* for multiple pollers, we need to know this location */
27  if (!isset($scripts_path)) {
28 --- cacti-0.8.7g/include/config.php~    2010-12-13 12:15:08.000000000 +0200
29 +++ cacti-0.8.7g/include/config.php     2010-12-13 12:16:09.275611204 +0200
30 @@ -27,8 +27,8 @@
31  $database_type     = 'mysql';
32  $database_default  = 'cacti';
33  $database_hostname = 'localhost';
34 -$database_username = 'cactiuser';
35 -$database_password = 'cactiuser';
36 +$database_username = 'mysql';
37 +$database_password = '';
38  $database_port     = '3306';
39  $database_ssl      = false;
40  
41 --- cacti/poller.php~   2017-08-28 05:48:36.000000000 +0200
42 +++ cacti/poller.php    2017-08-31 08:39:19.780902180 +0200
43 @@ -26,7 +26,7 @@
44  /* tick use required as of PHP 4.3.0 to accomodate signal handling */
45  declare(ticks = 1);
46  
47 -require(__DIR__ . '/include/cli_check.php');
48 +require('/usr/share/cacti/include/cli_check.php');
49  require_once($config['base_path'] . '/lib/poller.php');
50  require_once($config['base_path'] . '/lib/data_query.php');
51  require_once($config['base_path'] . '/lib/rrd.php');
52
53 diff -ur cacti-1.2.6.org/install/functions.php cacti-1.2.6/install/functions.php
54 --- cacti-1.2.6.org/install/functions.php       2019-09-02 10:23:43.000000000 +0200
55 +++ cacti-1.2.6/install/functions.php   2019-09-26 11:19:59.780907049 +0200
56 @@ -794,8 +794,8 @@
57                         $section = 'general';
58                 }
59                 $logfile = 'install' . '-' . $section;
60 -               file_put_contents($config['base_path'] . '/log/' . $logfile . '.log', sprintf($format_log1, $day, $time, $levelname, $data, PHP_EOL), $flags);
61 -               file_put_contents($config['base_path'] . '/log/install-complete.log', sprintf($format_log2, $day, $time, $sectionname, $levelname, $data, PHP_EOL), $flags);
62 +               file_put_contents('/var/log/cacti/' . $logfile . '.log', sprintf($format_log1, $day, $time, $levelname, $data, PHP_EOL), $flags);
63 +               file_put_contents('/var/log/cacti/install-complete.log', sprintf($format_log2, $day, $time, $sectionname, $levelname, $data, PHP_EOL), $flags);
64         }
65  }
66  
67 diff -ur cacti-1.2.6.org/lib/installer.php cacti-1.2.6/lib/installer.php
68 --- cacti-1.2.6.org/lib/installer.php   2019-09-02 10:23:43.000000000 +0200
69 +++ cacti-1.2.6/lib/installer.php       2019-09-26 11:20:54.749208954 +0200
70 @@ -465,7 +465,6 @@
71  
72                 $always_paths = array(
73                         sys_get_temp_dir(),
74 -                       $config['base_path'] . '/log',
75                         $config['base_path'] . '/cache/boost',
76                         $config['base_path'] . '/cache/mibcache',
77                         $config['base_path'] . '/cache/realtime',
78 @@ -3216,7 +3215,7 @@
79                 global $config;
80  
81                 $page_nr = 1;
82 -               $logcontents = tail_file($config['base_path'] . '/log/cacti.log', 100, -1, ' INSTALL:' , $page_nr, $total_rows);
83 +               $logcontents = tail_file('/var/log/cacti/cacti.log', 100, -1, ' INSTALL:' , $page_nr, $total_rows);
84  
85                 $output_log = '';
86                 foreach ($logcontents as $logline) {
This page took 0.033116 seconds and 4 git commands to generate.