Explorar o código

check_users not accepting zero as the threshold

Fix for issue #228
John C. Frickson %!s(int64=9) %!d(string=hai) anos
pai
achega
2c510d45a4
Modificáronse 2 ficheiros con 9 adicións e 4 borrados
  1. 5 0
      NEWS
  2. 4 4
      plugins/check_users.c

+ 5 - 0
NEWS

@@ -1,5 +1,10 @@
 This file documents the major additions and syntax changes between releases.
 
+x.x.x xxxx-xx-xx
+	FIXES
+	check_users: not accepting zero as the threshold
+
+
 2.2.0 2017-01-19
 	ENHANCEMENTS
 	check_flexlm: if `-F <license file>` is not specified, will use `LM_LICENSE_FILE` environment var

+ 4 - 4
plugins/check_users.c

@@ -222,10 +222,10 @@ process_arguments (int argc, char **argv)
 	/* this will abort in case of invalid ranges */
 	set_thresholds (&thlds, warning_range, critical_range);
 
-	if (thlds->warning->end <= 0)
-		usage4 (_("Warning threshold must be a positive integer"));
-	if (thlds->critical->end <= 0)
-		usage4 (_("Critical threshold must be a positive integer"));
+	if (thlds->warning->end < 0)
+		usage4 (_("Warning threshold must be a zero or greater"));
+	if (thlds->critical->end < 0)
+		usage4 (_("Critical threshold must be a zero or greater"));
 
 	return OK;
 }