[patch] fix for conversion of \n to <BR> (in CGIs)

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
marek.kaminski.1112
Posts: 3
Joined: Tue Oct 21, 2014 5:17 am

[patch] fix for conversion of \n to <BR> (in CGIs)

Post by marek.kaminski.1112 »

Dear All,

I've found out that CGIs in nagios 3.2.2 (e.g. in extinfo.cgi, in long plugin output) converts successfully \n (written as two characters) to <BR>, while in nagios 4.0.20130912, the conversion is broken.

One reason of the problem is: 'n' in the source code of cgiutils.c in 3.2.2 has been replaced with '\n' in 4.0.20130912 what is obviously not the same.

Also two other related corrections were needed (as new functionality has been added and was affected too).

The fix is in attachment. I hope it will help someone.

Best regards,
Marek Kaminski [ marek.kaminski.1112 (at) gmail.com ]
Attachments
cgiutils.c.nagios-4.0.20130912.patch.txt
(1.3 KiB) Downloaded 399 times
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: [patch] fix for conversion of \n to <BR> (in CGIs)

Post by tmcdonald »

I'll definitely take a look at this and see if the developers can do anything with it. Thanks for the patch!
Former Nagios employee
marek.kaminski.1112
Posts: 3
Joined: Tue Oct 21, 2014 5:17 am

Re: [patch] fix for conversion of \n to <BR> (in CGIs)

Post by marek.kaminski.1112 »

tmcdonald wrote:I'll definitely take a look at this and see if the developers can do anything with it. Thanks for the patch!
You're welcome :-) As it took me some time to prepare it, I really think that if it (or other solution to the problem) is included in future releases, it could save time and frustration of other nagios users facing the issue.

So thanks for looking what developers can do with it.

Best regards,
Marek Kaminski [ marek.kaminski.1112 (at) gmail.com ]
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: [patch] fix for conversion of \n to <BR> (in CGIs)

Post by tmcdonald »

I'll leave the topic open for now in case the dev needs to contact you for any reason.
Former Nagios employee
Locked