diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2007-11-11 16:29:05 +0000 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2007-11-11 16:29:05 +0000 |
commit | 1bb5e1e2ff07aaa9dc986807e25cf7243647f72f (patch) | |
tree | 89a4fc77ad7e8196049fd0f2589d50e7c02ce2ef | |
parent | b24243c2d93511d57ad028b25389795a0094291a (diff) | |
download | monitoring-plugins-1bb5e1e2ff07aaa9dc986807e25cf7243647f72f.tar.gz |
Fix broken usage2 in check_snmp and check_cluster
Fix check_cluster blocking some special characters for thresholds ("-", "@", "~")
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1827 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | plugins/check_cluster.c | 4 | ||||
-rw-r--r-- | plugins/check_snmp.c | 4 |
3 files changed, 4 insertions, 6 deletions
@@ -9,6 +9,8 @@ This file documents the major additions and syntax changes between releases. and the offset is unavailable, will return UNKNOWN as well. NOTE: If jitter thresholds are specified integers it will return CRITICAL if jitter is "-1" as the default range starts at 0. See Examples in --help output. + Fix broken usage2 in check_snmp and check_cluster + check_cluster now accept all valid characters in its thresholds ("-", "@", "~") 1.4.10 28th September 2007 Fix check_http buffer overflow vulnerability when following HTTP redirects diff --git a/plugins/check_cluster.c b/plugins/check_cluster.c index 703fff97..f1568d5a 100644 --- a/plugins/check_cluster.c +++ b/plugins/check_cluster.c @@ -178,14 +178,10 @@ int process_arguments(int argc, char **argv){ break; case 'w': /* warning threshold */ - if (strspn (optarg, "0123456789:,") < strlen (optarg)) - usage2 (_("Invalid warning threshold: %s\n"), optarg); warn_threshold = strdup(optarg); break; case 'c': /* warning threshold */ - if (strspn (optarg, "0123456789:,") < strlen (optarg)) - usage2 (_("Invalid critical threshold: %s\n"), optarg); crit_threshold = strdup(optarg); break; diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 9fa4a60b..c69e97aa 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -521,7 +521,7 @@ process_arguments (int argc, char **argv) /* Test parameters */ case 'c': /* critical time threshold */ if (strspn (optarg, "0123456789:,") < strlen (optarg)) - usage2 (_("Invalid critical threshold: %s\n"), optarg); + usage2 (_("Invalid critical threshold"), optarg); for (ptr = optarg; ptr && jj < MAX_OIDS; jj++) { if (llu_getll (&lower_crit_lim[jj], ptr) == 1) eval_method[jj] |= CRIT_LT; @@ -532,7 +532,7 @@ process_arguments (int argc, char **argv) break; case 'w': /* warning time threshold */ if (strspn (optarg, "0123456789:,") < strlen (optarg)) - usage2 (_("Invalid warning threshold: %s\n"), optarg); + usage2 (_("Invalid warning threshold"), optarg); for (ptr = optarg; ptr && ii < MAX_OIDS; ii++) { if (llu_getll (&lower_warn_lim[ii], ptr) == 1) eval_method[ii] |= WARN_LT; |