[Nagiosplug-devel] [ nagiosplug-Patches-2179754 ] [patch] Exception in check_nt.c
SourceForge.net
noreply at sourceforge.net
Sun Oct 19 15:42:30 CEST 2008
Patches item #2179754, was opened at 2008-10-19 15:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=2179754&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: Bugfix
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: mumpitz (ohauer)
Assigned to: Nobody/Anonymous (nobody)
Summary: [patch] Exception in check_nt.c
Initial Comment:
routine CHECK_USEDDISKSPACE in check_nt.c do not handle correct unknown/missing drives.
# /usr/local/libexec/nagios/check_nt -H HOSTNAME -p 12489 -v USEDDISKSPACE -l d
Segmentation fault: 11 (core dumped)
# /usr/local/libexec/nagios/check_nt -H HOSTNAME -p 12489 -v USEDDISKSPACE -l e
Segmentation fault: 11 (core dumped)
# echo "None&4&d" | nc HOSTNAME 12489
UNKNOWN: Drive is not a fixed drive: d: (it is a cdrom drive)
# echo "None&4&e" | nc HOSTNAME 12489
UNKNOWN: Could not get free space for: e: e: reason: 3: The system cannot find the path specified.
#################################
snipped from the code:
#################################
case CHECK_USEDDISKSPACE:
fetch_data (server_address, server_port, send_buffer);
/* --> no exception handling */
free_disk_space=atof(strtok(recv_buffer,"&"));
total_disk_space=atof(strtok(NULL,"&"));
The patch is maybe not optimal, but prevents segfault
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=2179754&group_id=29880
More information about the Devel
mailing list