1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-09-28 16:33:46 +02:00

Inserted the UID into the temp files - otherwise its very easy to

accidentally make temp files inaccessible by running as a non-nagios user
This commit is contained in:
ash 2017-02-09 17:52:00 +00:00
parent e7290f2a89
commit 8ebed28a47

View File

@ -279,7 +279,7 @@ $fname = $opt_i;
$fname =~ s/:/-/g; $fname =~ s/:/-/g;
$fname =~ s/\//-/g; $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 ) { if ( $opt_d ) {
print "Using temporary file: $fname\n"; print "Using temporary file: $fname\n";
} }
@ -630,8 +630,8 @@ sub get_config
if ($qos_config_value == $class_id ) { if ($qos_config_value == $class_id ) {
foreach $ifIndex (sort keys %qos_interfaces) { foreach $ifIndex (sort keys %qos_interfaces) {
if ($ifIndex eq $qos_index[0]) { if ($ifIndex eq $qos_index[0]) {
$tmp = $ifIndex . "." . $ifIndex; my $tmpi = $ifIndex . "." . $ifIndex;
$policyIndex = $qos_config{$tmp}; $policyIndex = $qos_config{$tmpi};
$policyName = $qos_policies{$policyIndex}; $policyName = $qos_policies{$policyIndex};
$ifPolicy = $qos_interfaces{$ifIndex}; $ifPolicy = $qos_interfaces{$ifIndex};
$post_oid = $cbQosCMPostPolicyByte.".".$i; $post_oid = $cbQosCMPostPolicyByte.".".$i;