[Nagiosplug-devel] [ nagiosplug-Bugs-1055054 ] [PATCH] Fix segfauly in check_nwstat.c

SourceForge.net noreply at sourceforge.net
Mon Dec 6 18:42:03 CET 2004


Bugs item #1055054, was opened at 2004-10-26 20:26
Message generated for change (Comment added) made by mattkent
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1055054&group_id=29880

Category: None
Group: Release (specify)
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Phil Dibowitz (jaymzh)
Assigned to: Matthew Kent (mattkent)
Summary: [PATCH] Fix segfauly in check_nwstat.c

Initial Comment:
The attached patch fixes a segfault in check_nwstat.c.
If the script can't get netware version, it does:     
                                                 

    asprintf(&netware_version,"");

Which despite what one would hope, actually sets the
POINTER to NULL, per a long-standing, documented bug in
the gnu library - which they keep for backwards
compatibility, best I can tell.                       
               

Anyway, in the cases where there's nothing to copy, I
simply use a strdup which prevents the segfault. Please
apply.                                      


----------------------------------------------------------------------

>Comment By: Matthew Kent (mattkent)
Date: 2004-12-06 18:41

Message:
Logged In: YES 
user_id=983566

Great stuff.

----------------------------------------------------------------------

Comment By: Phil Dibowitz (jaymzh)
Date: 2004-12-06 13:42

Message:
Logged In: YES 
user_id=533101

Looks good to me!

Thanks.

- Phil

----------------------------------------------------------------------

Comment By: Matthew Kent (mattkent)
Date: 2004-12-06 13:23

Message:
Logged In: YES 
user_id=983566

Can you try a snapshot from
http://nagiosplug.sourceforge.net/snapshot/ instead? If it
complains about system time being out of sync just run 

touch `find .`

within the nagios-plugins-HEAD-200412061747 directory.

----------------------------------------------------------------------

Comment By: Phil Dibowitz (jaymzh)
Date: 2004-12-06 12:21

Message:
Logged In: YES 
user_id=533101

I'm unable to get CVS to compile.

During automake a I get all sorts of issues:

/usr/bin/autopoint: line 259: fatal_error: command not found
find: tmpwrk480/archive: No such file or directory
configure.in: installing `./mkinstalldirs'
configure.in: installing `./missing'
configure.in:8: installing `./config.guess'
configure.in:8: installing `./config.sub'
Makefile.am: installing `./INSTALL'
aclocal.m4:1736: required file `./ABOUT-NLS' not found
lib/Makefile.am:6: automatically discovered file `fsusage.c'
should not be explicitly mentioned
lib/Makefile.am: installing `./depcomp'
lib/Makefile.am:6: automatically discovered file `fsusage.c'
should not be explicitly mentioned


and then I'm able to configure okay, except that it failes
to make one of the Makefiles:

config.status: error: cannot find input file: intl/Makefile.in

Which means I obviously can't make:

[phil at frantic nagiosplug]$ make
cd . && /bin/bash ./config.status config.h
config.status: creating config.h
make  all-recursive
Making all in intl
make: Fatal error: Don't know how to make target `all'
Current working directory
/auto/src/common/usc/nagios/nagiostest/nagiosplug/intl
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory
/auto/src/common/usc/nagios/nagiostest/nagiosplug
*** Error code 1
make: Fatal error: Command failed for target `all'
[phil at frantic nagiosplug]$ gmake
gmake  all-recursive
gmake[1]: Entering directory
`/auto/src/common/usc/nagios/nagiostest/nagiosplug'
Making all in intl
gmake[2]: Entering directory
`/auto/src/common/usc/nagios/nagiostest/nagiosplug/intl'
gmake[2]: *** No rule to make target `all'.  Stop.
gmake[2]: Leaving directory
`/auto/src/common/usc/nagios/nagiostest/nagiosplug/intl'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory
`/auto/src/common/usc/nagios/nagiostest/nagiosplug'
gmake: *** [all] Error 2
[phil at frantic nagiosplug]$ 

I tried just making in the plugins directory, but
dependencies are missing:

[phil at frantic nagiosplug]$ cd plugins
[phil at frantic plugins]$ make deps
make: Warning: Can't find `.deps/check_by_ssh.Po': No such
file or directory
make: Fatal error in reader: Makefile, line 602: Read of
include file `.deps/check_by_ssh.Po' failed

So I can't test it....

-Phil



----------------------------------------------------------------------

Comment By: Phil Dibowitz (jaymzh)
Date: 2004-11-24 00:24

Message:
Logged In: YES 
user_id=533101

Not until I get back -- this check_nwstat.c can't be dropped
into my current directory and rerun make, and I'm about to
head on vacation. I'll check it next wee for you.

- Phil

----------------------------------------------------------------------

Comment By: Matthew Kent (mattkent)
Date: 2004-11-23 20:34

Message:
Logged In: YES 
user_id=983566

Okay, well I've applied the patch you added, would you be
able to test? I lack a Novell server unfortunately.

----------------------------------------------------------------------

Comment By: Phil Dibowitz (jaymzh)
Date: 2004-11-22 12:01

Message:
Logged In: YES 
user_id=533101

The code in the latest CVS changes:
  asprintf(&netware_version,"");
to
  asprintf(&netware_version,"%s","");

but that still segfaults for me...

- Phil

----------------------------------------------------------------------

Comment By: Matthew Kent (mattkent)
Date: 2004-11-20 14:54

Message:
Logged In: YES 
user_id=983566

Looks like this was fixed in rev 1.9. Would you be able to
try a recent snapshot?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1055054&group_id=29880




More information about the Devel mailing list