[Nagios-devel] Nagios 4: Commands are unescaped twice

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Nagios 4: Commands are unescaped twice

Post by Guest »

Hello,

Whilst doing some testing on Nagios 4 I noticed that check commands with
arguments containing sequential backslashes are unescaped twice.

In Nagios 3, the following check_command:

check_nrpe!CheckCounter!ShowAll "Counter:Processor Time
(%)=\\\\Processor(_Total)\\% Processor Time"

is executed as:

check_nrpe -H foobar -a CheckCounter -c 'ShowAll "Counter:Processor Time
(%)=\\Processor(_Total)\% Processor Time"'

However in Nagios 4 it is executed as:

check_nrpe -H foobar -a CheckCounter -c 'ShowAll "Counter:Processor Time
(%)=\Processor(_Total)% Processor Time"'

This is due to the backslash being unescaped in base/utils.c around line
638 [1] and again in lib/runcmd.c around line 153 [2].

I fixed this by removing the escape code in lib/runcmd.c, but I have my
doubts about whether it is the correct solution.

Any thoughts?

Cheers,

Adam

[1] https://github.com/ageric/nagios/blob/m ... cmd.c#L153
[2] https://github.com/ageric/nagios/blob/m ... ils.c#L638
--
Open Source Consultant, Transitiv Technologies Ltd.

Business Critical Support and Services for Open Source Software.

T: 0203 384 7207
E: adam.james@transitiv.co.uk
W: http://www.transitiv.co.uk





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: adam.james@transitiv.co.uk
Locked