Nagios 3 CGI backslash stripping
Mike Emigh
maemigh at gmail.com
Mon Apr 14 20:34:07 CEST 2008
Hi everyone,
I'm not sure if this is the proper place to report this, but I could
not find a bug tracker associated with Nagios. There appears to be a
problem with the way the CGIs strip backslashes from plugin output.
The code which strips them appears to assume that whenever there is a
backslash, then it is escaping the next character. However, this is
not always the case. For example, backslashes on Windows partitions
consist of a single backslash which shouldn't be removed.
Copy and paste from status.dat:
plugin_output=OK: C:\: Total: 68.2G - Used: 12.6G (18%) - Free: 55.6G (82%)
In order to fix the problem on our install, I've commented out line
787 and replaced it with 788. I've also commented out 789. As far as
I can tell, this change has not had an adverse effect on any other
output.
cgiutils.c:
785 /* unescape backslashes and other stuff */
786 else{
787 /* rawbuf[y++]=rawbuf[x+1]; */
788 rawbuf[y++]=rawbuf[x];
789 /* x++; */
790 }
Mike
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list