Bugfix for skipping non-cfg files in "cfg_dir"

Ethan Galstad nagios at nagios.org
Wed Nov 9 00:16:21 CET 2005


Thanks!  Patch will be in CVS shortly.

On 8 Oct 2005 at 3:57, Holger Weiss wrote:

> We have RCS files within (subdirectories of) the Nagios configuration
> directories.  Since these files don't have a ".cfg" suffix, they should
> be ignored by Nagios.  However, Nagios _sometimes_ treats these files as
> if they were directories and bails out because it can't opendir() them.
> This happens because
> 
> 1) only the file name but not the full path is passed to the stat() call
>    which is done for checking the type of a non-cfg file[1], and then
> 2) the return value of this stat() call is interpreted the wrong way
>    round: "!=0" is treated as "success" and therefore "stat_buf" will be
>    read.  This is also done for an earlier stat() call[2] (which is not
>    related to this bug though).
> 
> The attached patch fixes these problems.
> 
> Holger
> 
> [1] xdata/xodtemplate.c:422
> [2] xdata/xodtemplate.c:399
> 
> -- 
> PGP fingerprint:  F1F0 9071 8084 A426 DD59  9839 59D3 F3A1 B8B5 D3DE
> 



Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php




More information about the Developers mailing list