aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--NEWS8
-rwxr-xr-xNP-VERSION-GEN2
-rw-r--r--THANKS.in1
-rw-r--r--configure.ac2
-rw-r--r--doc/RELEASING38
-rw-r--r--plugins-root/check_icmp.c7
-rw-r--r--plugins/check_apt.c2
-rw-r--r--plugins/check_ntp.c25
-rw-r--r--plugins/check_real.c2
-rw-r--r--plugins/check_tcp.c2
11 files changed, 41 insertions, 49 deletions
diff --git a/.gitignore b/.gitignore
index 8ea2d8e5..3093c6ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,7 @@ NP-VERSION-FILE
/build-aux/install-sh
/build-aux/missing
/build-aux/mkinstalldirs
+/build-aux/test-driver
# /doc/
/doc/developer-guidelines.html
diff --git a/NEWS b/NEWS
index c01e33c6..a923e824 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,14 @@ This file documents the major additions and syntax changes between releases.
changed to comply with the development guidelines
check_ssh not returns CRITICAL for protocal/version errors
+2.1.1 2nd December 2014
+ FIXES
+ Fix check_ntp's jitter checking
+ Fix check_ntp's handling of invalid server responses
+ Fix check_apt's handling of invalid regular expressions
+ Fix check_real's server response processing
+ Fix backslash escaping in check_tcp's --help output
+
2.1 15th October 2014
ENHANCEMENTS
New check_hpjd -p option for port specification (abrist)
diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN
index 1878eb9c..12efad72 100755
--- a/NP-VERSION-GEN
+++ b/NP-VERSION-GEN
@@ -6,7 +6,7 @@
SRC_ROOT=`dirname $0`
NPVF=NP-VERSION-FILE
-DEF_VER=2.1.git
+DEF_VER=2.1.1.git
LF='
'
diff --git a/THANKS.in b/THANKS.in
index eefe583c..6c9e1fe4 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -333,3 +333,4 @@ Frederic Krueger
Simon Meggle
Jonas Genannt
Nick Peelman
+Sebastian Herbszt
diff --git a/configure.ac b/configure.ac
index 3cc3d03d..fb8f9500 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT(monitoring-plugins,2.1)
+AC_INIT(monitoring-plugins,2.1.1)
AC_CONFIG_SRCDIR(NPTest.pm)
AC_CONFIG_FILES([gl/Makefile])
AC_CONFIG_AUX_DIR(build-aux)
diff --git a/doc/RELEASING b/doc/RELEASING
index 1eaec9de..eee53d7b 100644
--- a/doc/RELEASING
+++ b/doc/RELEASING
@@ -1,4 +1,4 @@
-NOTES ON RELEASING NEW VERSION OF NAGIOSPLUG
+NOTES ON RELEASING NEW VERSION OF MONITORING-PLUGINS
*** Pre-release
git pull
@@ -6,25 +6,23 @@ git pull
check compilation, check tinderbox screens
*** Prepare and commit files
-Update BUGS, NEWS file
+Update NEWS file
Update AUTHORS if new members
-Update configure.in, package.def and NP-VERSION-GEN with version
-Run git2cl (get from http://josefsson.org/git2cl/):
-git2cl >Changelog
-commit BUGS NEWS configure.in package.def ChangeLog
+Update configure.ac and NP-VERSION-GEN with version
+commit NEWS configure.ac NP-VERSION-GEN
*** Create new annotated tag
-git tag -a release-1.4.14 -m release-1.4.14
+git tag -a v2.1.1 -m v2.1.1
*** Push the code and tag to origin
git push origin master
-git push origin release-1.4.14
+git push origin v2.1.1
*** Checkout new version
rm -fr /tmp/monitoringlug
# If you need to checkout the tag, don't forget to "checkout master" later to
# get back to your development branch:
-git checkout tags/release-1.4.14
+git checkout tags/v2.1.1
# Beware: the trailing slash of --prefix is REQUIRED
git checkout-index --prefix=/tmp/monitoringlug/ -a
@@ -34,27 +32,7 @@ tools/setup
./configure
make dist
-*** Upload generated tarball to sourceforge
-sftp frs.sourceforge.net
-SF username and password
-cd /uploads
-put file
-
-SF -> Submit News about release. Make sure it is called "Monitoring Plugins" (with those caps)
-Link to download at http://sourceforge.net/project/showfiles.php?group_id=29880
-Include contents of NEWS for this release
-List all people on team involved.
-Add acknowledgement to contributors
-Submit. Get URL to news item
-
-SF -> Admin -> File Releases
-Add a release to nagiosplug and create a file release
-Name: 1.4.14
-Create release
-Step 1: Add release notes pointing to news item
-Step 2: add file
-Step 3: *.tar.gz, Platform Independent, Source .gz
-Step 4: Send notice
+*** Upload generated tarball to our Project Site
*** Announce new release
Send email to help, announce with the news text
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 44c6826c..3982def9 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -786,7 +786,8 @@ wait_for_reply(int sock, u_int t)
memcpy(&data, icp.icmp_data, sizeof(data));
if (debug > 2)
printf("ICMP echo-reply of len %lu, id %u, seq %u, cksum 0x%X\n",
- sizeof(data), ntohs(icp.icmp_id), ntohs(icp.icmp_seq), icp.icmp_cksum);
+ (unsigned long)sizeof(data), ntohs(icp.icmp_id),
+ ntohs(icp.icmp_seq), icp.icmp_cksum);
host = table[ntohs(icp.icmp_seq)/packets];
tdiff = get_timevaldiff(&data.stime, &now);
@@ -865,7 +866,9 @@ send_icmp_ping(int sock, struct rta_host *host)
if (debug > 2)
printf("Sending ICMP echo-request of len %lu, id %u, seq %u, cksum 0x%X to host %s\n",
- sizeof(data), ntohs(packet.icp->icmp_id), ntohs(packet.icp->icmp_seq), packet.icp->icmp_cksum, host->name);
+ (unsigned long)sizeof(data), ntohs(packet.icp->icmp_id),
+ ntohs(packet.icp->icmp_seq), packet.icp->icmp_cksum,
+ host->name);
memset(&iov, 0, sizeof(iov));
iov.iov_base = packet.buf;
diff --git a/plugins/check_apt.c b/plugins/check_apt.c
index 07622c2f..8747f904 100644
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
@@ -224,7 +224,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount){
char *cmdline=NULL, rerrbuf[64];
/* initialize ereg as it is possible it is printed while uninitialized */
- memset(&ereg, "\0", sizeof(ereg.buffer));
+ memset(&ereg, '\0', sizeof(ereg.buffer));
if(upgrade==NO_UPGRADE) return STATE_OK;
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index 09a923eb..a7d278de 100644
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
@@ -517,14 +517,13 @@ setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){
double jitter_request(const char *host, int *status){
int conn=-1, i, npeers=0, num_candidates=0, syncsource_found=0;
int run=0, min_peer_sel=PEER_INCLUDED, num_selected=0, num_valid=0;
- int peers_size=0, peer_offset=0, bytes_read=0;
+ int peers_size=0, peer_offset=0;
ntp_assoc_status_pair *peers=NULL;
ntp_control_message req;
const char *getvar = "jitter";
double rval = 0.0, jitter = -1.0;
char *startofvalue=NULL, *nptr=NULL;
void *tmp;
- int ntp_cm_ints = sizeof(uint16_t) * 5 + sizeof(uint8_t) * 2;
/* Long-winded explanation:
* Getting the jitter requires a number of steps:
@@ -591,6 +590,9 @@ double jitter_request(const char *host, int *status){
for (i = 0; i < npeers; i++){
/* Only query this server if it is the current sync source */
if (PEER_SEL(peers[i].status) >= min_peer_sel){
+ char jitter_data[MAX_CM_SIZE+1];
+ size_t jitter_data_count;
+
num_selected++;
setup_control_request(&req, OP_READVAR, 2);
req.assoc = peers[i].assoc;
@@ -609,15 +611,7 @@ double jitter_request(const char *host, int *status){
req.count = htons(MAX_CM_SIZE);
DBG(printf("recieving READVAR response...\n"));
-
- /* cov-66524 - req.data not null terminated before usage. Also covers verifying struct was returned correctly*/
- if ((bytes_read = read(conn, &req, SIZEOF_NTPCM(req))) == -1)
- die(STATE_UNKNOWN, _("Cannot read from socket: %s"), strerror(errno));
- if (bytes_read != ntp_cm_ints + req.count)
- die(STATE_UNKNOWN, _("Invalid NTP response: %d bytes read does not equal %d plus %d data segment"), bytes_read, ntp_cm_ints, req.count);
- /* else null terminate */
- strncpy(req.data[req.count], "\0", 1);
-
+ read(conn, &req, SIZEOF_NTPCM(req));
DBG(print_ntp_control_message(&req));
if(req.op&REM_ERROR && strstr(getvar, "jitter")) {
@@ -632,7 +626,14 @@ double jitter_request(const char *host, int *status){
if(verbose) {
printf("parsing jitter from peer %.2x: ", ntohs(peers[i].assoc));
}
- startofvalue = strchr(req.data, '=');
+ if((jitter_data_count = ntohs(req.count)) >= sizeof(jitter_data)){
+ die(STATE_UNKNOWN,
+ _("jitter response too large (%lu bytes)\n"),
+ (unsigned long)jitter_data_count);
+ }
+ memcpy(jitter_data, req.data, jitter_data_count);
+ jitter_data[jitter_data_count] = '\0';
+ startofvalue = strchr(jitter_data, '=');
if(startofvalue != NULL) {
startofvalue++;
jitter = strtod(startofvalue, &nptr);
diff --git a/plugins/check_real.c b/plugins/check_real.c
index e7ab9d04..00bd4d20 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -178,7 +178,7 @@ main (int argc, char **argv)
/* watch for the REAL connection string */
result = recv (sd, buffer, MAX_INPUT_BUFFER - 1, 0);
- buffer[result] = "\0"; /* null terminate recieved buffer */
+ buffer[result] = '\0'; /* null terminate recieved buffer */
/* return a CRITICAL status if we couldn't read any data */
if (result == -1) {
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index fc0adba0..63f9fd9c 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -643,7 +643,7 @@ print_help (void)
printf (UT_IPv46);
printf (" %s\n", "-E, --escape");
- printf (" %s\n", _("Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option"));
+ printf (" %s\n", _("Can use \\n, \\r, \\t or \\\\ in send or quit string. Must come before send or quit option"));
printf (" %s\n", _("Default: nothing added to send, \\r\\n added to end of quit"));
printf (" %s\n", "-s, --send=STRING");
printf (" %s\n", _("String to send to the server"));