From 8ebed28a4763dbce47a862bdec65ec4218d9009e Mon Sep 17 00:00:00 2001 From: ash Date: Thu, 9 Feb 2017 17:52:00 +0000 Subject: [PATCH] Inserted the UID into the temp files - otherwise its very easy to accidentally make temp files inaccessible by running as a non-nagios user --- check_cisco_qos/check_cisco_qos.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_cisco_qos/check_cisco_qos.pl b/check_cisco_qos/check_cisco_qos.pl index fe58d4e..495ea06 100755 --- a/check_cisco_qos/check_cisco_qos.pl +++ b/check_cisco_qos/check_cisco_qos.pl @@ -279,7 +279,7 @@ $fname = $opt_i; $fname =~ s/:/-/g; $fname =~ s/\//-/g; $fname =~ s/\./-/g; -$fname = $tmp . "/check_cisco_qos." . $hostname . "." . $fname . "." . $class; +$fname = $tmp . "/check_cisco_qos." . $> . "." . $hostname . "." . $fname . "." . $class; if ( $opt_d ) { print "Using temporary file: $fname\n"; } @@ -630,8 +630,8 @@ sub get_config if ($qos_config_value == $class_id ) { foreach $ifIndex (sort keys %qos_interfaces) { if ($ifIndex eq $qos_index[0]) { - $tmp = $ifIndex . "." . $ifIndex; - $policyIndex = $qos_config{$tmp}; + my $tmpi = $ifIndex . "." . $ifIndex; + $policyIndex = $qos_config{$tmpi}; $policyName = $qos_policies{$policyIndex}; $ifPolicy = $qos_interfaces{$ifIndex}; $post_oid = $cbQosCMPostPolicyByte.".".$i;