summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f839815)
raw | patch | inline | side by side (parent: f839815)
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Sat, 5 Jan 2008 14:09:29 +0000 (14:09 +0000) | ||
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Sat, 5 Jan 2008 14:09:29 +0000 (14:09 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1887 f882894a-f735-0410-b71e-b25c423dba1c
NEWS | patch | blob | history | |
plugins/check_ntp.c | patch | blob | history | |
plugins/check_ntp_time.c | patch | blob | history |
index 485693afe23116bd0dd1642182b2837ab74ecec8..a58c4cecb8e2664532dcb88b835777aa5251e402 100644 (file)
--- a/NEWS
+++ b/NEWS
check_tcp now returns UNKNOWN with invalid hostname
New check_icmp -s option to specify the source IP address
check_dns now sorts addresses for testing results for more than one returned IP (Matthias Urlichs)
+ Fix segfault in check_ntp_time and (deprecated) check_ntp. (Bug #1862300)
1.4.11 13th December 2007
Fixed check_http regression in 1.4.10 where following redirects to
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index 86e3d0985bf4f2ee57fbf020844dfa150d8a060a..b474d9a81c5a6313624f6ca4b35237ab521418ae 100644 (file)
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
/* if we haven't reached the current list's end, move everyone
* over one to the right, and insert the new candidate */
if(i<csize){
- for(j=5; j>i; j--){
+ for(j=4; j>i; j--){
candidates[j]=candidates[j-1];
}
}
servers=(ntp_server_results*)malloc(sizeof(ntp_server_results)*num_hosts);
if(servers==NULL) die(STATE_UNKNOWN, "can not allocate server array");
memset(servers, 0, sizeof(ntp_server_results)*num_hosts);
+ DBG(printf("Found %d peers to check\n", num_hosts));
/* setup each socket for writing, and the corresponding struct pollfd */
ai_tmp=ai;
printf ("Copyright (c) 2006 Sean Finney\n");
printf (COPYRIGHT, copyright, email);
-
- printf ("%s\n", _("This plugin checks the selected ntp server"));
- printf ("\n\n");
-
+ printf ("%s\n", _("This plugin checks the selected ntp server"));
+
+ printf ("\n\n");
+
print_usage();
printf (_(UT_HELP_VRSN));
printf (_(UT_HOST_PORT), 'p', "123");
printf(" %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200"));
printf (_(UT_SUPPORT));
+
+ printf("\n");
+ printf ("%s\n", _("WARNING: check_ntp is deprecated. Please use check_ntp_peer or"));
+ printf ("%s\n\n", _("check_ntp_time istead."));
}
void
print_usage(void)
{
- printf (_("Usage:"));
- printf(" %s -H <host> [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-v verbose]\n", progname);
+ printf ("%s\n", _("WARNING: check_ntp is deprecated. Please use check_ntp_peer or"));
+ printf ("%s\n\n", _("check_ntp_time istead."));
+ printf (_("Usage:"));
+ printf(" %s -H <host> [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-v verbose]\n", progname);
}
index f414c328891662fc43cd9f27e1a9e5740155f29d..767dcd9494f6cfdd7f7e50b63b2d8db05a569486 100644 (file)
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
/* if we haven't reached the current list's end, move everyone
* over one to the right, and insert the new candidate */
if(i<csize){
- for(j=5; j>i; j--){
+ for(j=4; j>i; j--){
candidates[j]=candidates[j-1];
}
}
servers=(ntp_server_results*)malloc(sizeof(ntp_server_results)*num_hosts);
if(servers==NULL) die(STATE_UNKNOWN, "can not allocate server array");
memset(servers, 0, sizeof(ntp_server_results)*num_hosts);
+ DBG(printf("Found %d peers to check\n", num_hosts));
/* setup each socket for writing, and the corresponding struct pollfd */
ai_tmp=ai;