Bug in statuswml.cgi with Acknowledging Services

Jon Angliss jon at netdork.net
Tue Aug 12 09:42:41 CEST 2008


On Mon, 11 Aug 2008 13:41:38 -0700 (PDT), Benjamin Schmaus
<schmaustech at yahoo.com> wrote:

>It appears there is a bug if you try to acknowledge a critical state via the WAP interface for a service on the host in Nagios 3.x.

Is this what has been causing the "You're not authorized" messages
I've been getting when trying to ack stuff?  

>Upon looking at the post HTML code, it appears that the service name being passed is the host on which that service is in a critical state.  
>
>Specifically this line in statuswml.c:
>
>printf("<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='com_author' value='$(name)'/><postfield name='com_data' value='$(comment)'/><postfield name='persistent' value=''/><postfield name='send_notification' value=''/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go>\n",COMMAND_CGI,url_encode(host_name),url_encode(service_desc),CMD_ACKNOWLEDGE_SVC_PROBLEM,CMDMODE_COMMIT);
>
>If this line is changed to:
>
>        printf("<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='com_author' value='$(name)'/><postfield name='com_data' value='$(comment)'/><postfield name='persistent' value=''/><postfield name='send_notification' value=''/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go>\n",COMMAND_CGI,url_encode(host_name),service_desc,CMD_ACKNOWLEDGE_SVC_PROBLEM,CMDMODE_COMMIT);
>
>Then it appears to work.

The only change I see you've made is a change to service_desc to not
be feed through url_encode() first. Did that really fix it for you? If
what you're saying about it passing the service as the host name, I
can't see how stripping out the url_encode from your line would
resolve that issue, and could cause issues if you had special
characters in the service description.

-- 
Jon Angliss


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/




More information about the Developers mailing list