[Nagios-devel] bug in setting of LASTHOSTCHECK macro (base/utils.c)

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] bug in setting of LASTHOSTCHECK macro (base/utils.c)

Post by Guest »

This is a multi-part message in MIME format.

------=_NextPart_000_0029_01C55BCB.6D0C2B90
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_002A_01C55BCB.6D0C2B90"


------=_NextPart_001_002A_01C55BCB.6D0C2B90
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi,



The LASTHOSTCHECK macro is being incorrectly set as hst->last_state_change.
It should be set as hst->last_check. Patch file is attached for
base/utils.c and included inline below.



Regards,





Dr. Dave Blunt

Regional Operations Manager

GroundWork Open Source Solutions





*** utils.c Thu Mar 24 17:04:19 2005

--- modified_utils.c Wed May 18 17:33:45 2005

***************

*** 866,870 ****

macro_x[MACRO_LASTHOSTCHECK]=(char *)malloc(MAX_DATETIME_LENGTH);

if(macro_x[MACRO_LASTHOSTCHECK]!=NULL){

!
snprintf(macro_x[MACRO_LASTHOSTCHECK],MAX_DATETIME_LENGTH,"%lu",(unsigned
long)hst->last_state_change);

macro_x[MACRO_LASTHOSTCHECK][MAX_DATETIME_LENGTH-1]='\x0';

}

--- 866,870 ----

macro_x[MACRO_LASTHOSTCHECK]=(char *)malloc(MAX_DATETIME_LENGTH);

if(macro_x[MACRO_LASTHOSTCHECK]!=NULL){

!
snprintf(macro_x[MACRO_LASTHOSTCHECK],MAX_DATETIME_LENGTH,"%lu",(unsigned
long)hst->last_check);

macro_x[MACRO_LASTHOSTCHECK][MAX_DATETIME_LENGTH-1]='\x0';

}






------=_NextPart_001_002A_01C55BCB.6D0C2B90
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable





















Hi,

 

The LASTHOSTCHECK macro is being incorrectly set as
hst->last_state_change.  It should be set as =
hst->last_check.  Patch file
is attached for base/utils.c and included inline =
below.

 

Regards,

 

 

Dr. Dave Blunt

Regional Operations =
Manager</font

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked