Просмотр исходного кода

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

Thomas Guyot-Sionnest 18 лет назад
Родитель
Сommit
1bb5e1e2ff
3 измененных файлов с 4 добавлено и 6 удалено
  1. 2 0
      NEWS
  2. 0 4
      plugins/check_cluster.c
  3. 2 2
      plugins/check_snmp.c

+ 2 - 0
NEWS

@@ -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.
 	  and the offset is unavailable, will return UNKNOWN as well.
 	  NOTE: If jitter thresholds are specified integers it will return CRITICAL if jitter
 	  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.
 	  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
 1.4.10 28th September 2007
 	Fix check_http buffer overflow vulnerability when following HTTP redirects
 	Fix check_http buffer overflow vulnerability when following HTTP redirects

+ 0 - 4
plugins/check_cluster.c

@@ -178,14 +178,10 @@ int process_arguments(int argc, char **argv){
 			break;
 			break;
 
 
 		case 'w': /* warning threshold */
 		case 'w': /* warning threshold */
-			if (strspn (optarg, "0123456789:,") < strlen (optarg))
-				usage2 (_("Invalid warning threshold: %s\n"), optarg);
 			warn_threshold = strdup(optarg);
 			warn_threshold = strdup(optarg);
 			break;
 			break;
 
 
 		case 'c': /* warning threshold */
 		case 'c': /* warning threshold */
-			if (strspn (optarg, "0123456789:,") < strlen (optarg))
-				usage2 (_("Invalid critical threshold: %s\n"), optarg);
 			crit_threshold = strdup(optarg);
 			crit_threshold = strdup(optarg);
 			break;
 			break;
 
 

+ 2 - 2
plugins/check_snmp.c

@@ -521,7 +521,7 @@ process_arguments (int argc, char **argv)
 	/* Test parameters */
 	/* Test parameters */
 		case 'c':									/* critical time threshold */
 		case 'c':									/* critical time threshold */
 			if (strspn (optarg, "0123456789:,") < strlen (optarg))
 			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++) {
 			for (ptr = optarg; ptr && jj < MAX_OIDS; jj++) {
 				if (llu_getll (&lower_crit_lim[jj], ptr) == 1)
 				if (llu_getll (&lower_crit_lim[jj], ptr) == 1)
 					eval_method[jj] |= CRIT_LT;
 					eval_method[jj] |= CRIT_LT;
@@ -532,7 +532,7 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'w':									/* warning time threshold */
 		case 'w':									/* warning time threshold */
 			if (strspn (optarg, "0123456789:,") < strlen (optarg))
 			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++) {
 			for (ptr = optarg; ptr && ii < MAX_OIDS; ii++) {
 				if (llu_getll (&lower_warn_lim[ii], ptr) == 1)
 				if (llu_getll (&lower_warn_lim[ii], ptr) == 1)
 					eval_method[ii] |= WARN_LT;
 					eval_method[ii] |= WARN_LT;