Re: [Nagios-devel] [BUG] Missing new line in cmd.cgi [3.0.5]

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

Re: [Nagios-devel] [BUG] Missing new line in cmd.cgi [3.0.5]

Post by Guest »

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andreas Ericsson schrieb:
> Olivier Beytrison wrote:
>> Hi there,
>>
>> I juste upgraded nagios to 3.0.5 and discovered a little bug with
>> the command cgi.
>>
>> If you want to submit a command (like Disable notifications for
>> all services on this host) and you check "Disable notification
>> for host too", the command is not correctly sent to Nagios.
>>
>> Here's the logfile result (:
>>
>> [1225963577] EXTERNAL COMMAND:
>> ENABLE_HOST_SVC_NOTIFICATIONS;hesidp[1225963577]
>> ENABLE_HOST_NOTIFICATIONS;hesidp
>>
>> As you can see, there's a missing new line, thus making 2
>> commands on one line, and unreadable for nagios.
>>
>> I saw that the code of cgi/cmd.c has been changed, I tried to
>> simply add a \n in the cmd_submitf() function, but didn't work.
>>
>> could you please look into this problem, and submit a patch ?
>>
>
> I'll look into it, yes. Thanks for reporting it.
>
I spent some time on this.
each external command has to end with a newline character because the
later fputs() to the command file.

@Andreas:
Do you see any security risk when putting an "\n" to the end of cmd in
"cmd_submitf()"?
Seems to me as the easiest way.

- -
Hendrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFJEu8KlI0PwfxLQjkRAnQ8AKCAjLYedcts5V3kJuOLEW4n/M9CXQCfcDRF
8//EIyU68hD2sP3hW5hVOEM=
=jSga
-----END PGP SIGNATURE-----






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked