Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.6k stars 397 forks source link

Update rrd.php missing variable $okpos #5773

Closed MSS970 closed 1 week ago

MSS970 commented 1 week ago

Update rrd.php missing variable $okpos

TheWitness commented 1 week ago

Can you redo this for 1.2.x branch or is it fine there?

MSS970 commented 1 week ago

I have been using Cacti 1.3 (Dev) for long time on Windows and did not test this issue on 1.2.x

MSS970 commented 1 week ago

I presume it is the same issue in Cacti 1.2.x, just checked the 1.2.x branch:

function rrdtool_trim_output(&$output) { global $config;

/* When using RRDtool with proc_open for long strings
 * and using the '-' to handle standard in from inside
 * the process, RRDtool automatically appends stderr
 * to stdout for batch programs to parse the output
 * string.  So, therefore, we have to prune that
 * output.
 */
if ($config['cacti_server_os'] == 'win32') {
    $output = rtrim($output, "OK \n\r");

/ MSS: missing variable here / } else { $okpos = strrpos($output, 'OK u:'); if ($okpos !== false) { $output = substr($output, 0, $okpos); } } }

TheWitness commented 1 week ago

Okay, I fixed this in 1.2.x and will cherry pick into 1.3 shortly.