[Nagiosplug-devel] [ nagiosplug-Bugs-1465288 ] core dunmp for many plugins under Solaris

SourceForge.net noreply at sourceforge.net
Wed Apr 5 13:07:07 CEST 2006


Bugs item #1465288, was opened at 2006-04-05 16:03
Message generated for change (Comment added) made by bubbafat
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1465288&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Argument proccessing
Group: CVS
Status: Open
Resolution: None
Priority: 5
Submitted By: Jason Kau (bubbafat)
Assigned to: Nobody/Anonymous (nobody)
Summary: core dunmp for many plugins under Solaris

Initial Comment:
On Solaris, many of the plugins core dump when 
provided with an invalid option:

./check_http -X
./check_http: invalid option -- X
Segmentation Fault (core dumped)

But not all:

./check_disk -Z
./check_disk: invalid option -- Z
Unknown argument
Usage: check_disk -w limit -c limit [-p path | -x 
device] [-t timeout][-m] [-e] [-W limit] [-K limit] [-
v] [-q]

plugins/utils.c is trying to printf a null char 
pointer.  Although many UNIXes catch this and print 
<NULL> or <null>, Solaris core dumps with SIGSEGV.

Thus I propose this following patch:

--- utils.c     Wed Apr  5 16:03:03 2006
+++ utils.c.orig        Wed Apr  5 16:00:59 2006
@@ -71,7 +71,7 @@

 void usage2(const char *msg, const char *arg)
 {
-       printf ("%s: %s - %s\n",progname,msg,arg?
arg:"(null)");
+       printf ("%s: %s - %s\n",progname,msg,arg);
        print_usage ();
        exit (STATE_UNKNOWN);
 }
@@ -79,7 +79,7 @@
 void
 usage3 (const char *msg, int arg)
 {
-       printf ("%s: %s - %c\n", progname, msg, arg?
arg:"(null)");
+       printf ("%s: %s - %c\n", progname, msg, arg);
        print_usage();
        exit (STATE_UNKNOWN);
 }


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

>Comment By: Jason Kau (bubbafat)
Date: 2006-04-05 16:06

Message:
Logged In: YES 
user_id=1495257

Oops, obviously I reversed that and meant:

--- utils.c.orig        Wed Apr  5 16:00:59 2006
+++ utils.c     Wed Apr  5 16:03:03 2006
@@ -71,7 +71,7 @@

 void usage2(const char *msg, const char *arg)
 {
-       printf ("%s: %s - %s\n",progname,msg,arg);
+       printf ("%s: %s - %s\n",progname,msg,arg?
arg:"(null)");
        print_usage ();
        exit (STATE_UNKNOWN);
 }
@@ -79,7 +79,7 @@
 void
 usage3 (const char *msg, int arg)
 {
-       printf ("%s: %s - %c\n", progname, msg, arg);
+       printf ("%s: %s - %c\n", progname, msg, arg?
arg:"(null)");
        print_usage();
        exit (STATE_UNKNOWN);
 }


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

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




More information about the Devel mailing list