This is a multi-part message in MIME format.
--------------050607050102070109060803
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hello,
After the waitpid() in nrpe WEXITSTATUS() is called without first
checking WIFEXITED() which leads to checks being reported ok if the
child for instance died on a signal. Attached patch adds a check to
WIFEXITED() before the WEXITSTATUS() check.
--
Klas Lindfors
Stockholm University
--------------050607050102070109060803
Content-Type: text/x-patch;
name="nrpe-checkexited.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nrpe-checkexited.patch"
Index: src/nrpe.c
===================================================================
RCS file: /cvsroot/nagios/nrpe/src/nrpe.c,v
retrieving revision 1.58
diff -u -p -b -w -r1.58 nrpe.c
--- src/nrpe.c 13 Aug 2007 17:10:08 -0000 1.58
+++ src/nrpe.c 30 Aug 2007 08:32:24 -0000
@@ -1343,6 +1343,8 @@ int my_system(char *command,int timeout,
/* report an error if we couldn't close the command */
if(status==-1)
result=STATE_CRITICAL;
+ else if(!WIFEXITED(status))
+ result=STATE_CRITICAL;
else
result=WEXITSTATUS(status);
}
--------------050607050102070109060803--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]