Page 1 of 1

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

Posted: Tue Oct 21, 2014 5:28 am
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 ]

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

Posted: Tue Oct 21, 2014 1:21 pm
by tmcdonald
I'll definitely take a look at this and see if the developers can do anything with it. Thanks for the patch!

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

Posted: Wed Oct 22, 2014 7:40 am
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 ]

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

Posted: Wed Oct 22, 2014 4:33 pm
by tmcdonald
I'll leave the topic open for now in case the dev needs to contact you for any reason.