Patches for Nagios current

Andreas Ericsson ae at op5.se
Thu Sep 30 14:32:28 CEST 2004


One of the patches fixes a SIGSEGV caused by one of two strdup(NULL) 
calls in xdata/xpddefault.c, where two variables (for perfdatafiles) 
aren't checked for NULL-ness before being strdup()'ed into the macro_x 
array. The patch properly replaces those macros with empty strings if 
the variables are NULL.

The second patch fixes an issue with commands not being sent because the 
command line might get chopped up.
 From what I read in the source, any line in any file can be any length 
nowadays (65536?), but notification commands are still being cut off at 
1024 chars. That's sort of silly, since it doesn't allow for all the 
macros available to fit in the notification command. This patch raises 
the bar to 4096, by use of MAX_COMMAND_BUFFER in include/common.h.
It might be prudent to rename that to MAX_NOTIFICATION_COMMAND_BUFFER 
and raise it further, but the patch at least points out the errors, and 
it's now big enough to contain all the macros in the form of 
MACRONAME=MACROVALUE and still leave about 1KiB for trivia.

Cheers

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nagios-cvs-strdup-with-NULL.diff
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20040930/c57b3475/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nagios-cvs-max_notification_cmd_len.diff
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20040930/c57b3475/attachment-0001.ksh>


More information about the Developers mailing list