[Nagiosplug-checkins] SF.net SVN: nagiosplug:[2181] nagiosplug/trunk/plugins/check_http.c

dermoth at users.sourceforge.net dermoth at users.sourceforge.net
Sat Mar 21 07:41:26 CET 2009


Revision: 2181
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2181&view=rev
Author:   dermoth
Date:     2009-03-21 06:41:26 +0000 (Sat, 21 Mar 2009)

Log Message:
-----------
check_http: die when an invalid --onredirect option is specified

From: Thomas Guyot-Sionnest <dermoth at aei.ca>

Modified Paths:
--------------
    nagiosplug/trunk/plugins/check_http.c

Modified: nagiosplug/trunk/plugins/check_http.c
===================================================================
--- nagiosplug/trunk/plugins/check_http.c	2009-03-21 06:41:16 UTC (rev 2180)
+++ nagiosplug/trunk/plugins/check_http.c	2009-03-21 06:41:26 UTC (rev 2181)
@@ -305,18 +305,19 @@
     case 'f': /* onredirect */
       if (!strcmp (optarg, "stickyport"))
         onredirect = STATE_DEPENDENT, followsticky = STICKY_HOST|STICKY_PORT;
-      if (!strcmp (optarg, "sticky"))
+      else if (!strcmp (optarg, "sticky"))
         onredirect = STATE_DEPENDENT, followsticky = STICKY_HOST;
-      if (!strcmp (optarg, "follow"))
+      else if (!strcmp (optarg, "follow"))
         onredirect = STATE_DEPENDENT, followsticky = STICKY_NONE;
-      if (!strcmp (optarg, "unknown"))
+      else if (!strcmp (optarg, "unknown"))
         onredirect = STATE_UNKNOWN;
-      if (!strcmp (optarg, "ok"))
+      else if (!strcmp (optarg, "ok"))
         onredirect = STATE_OK;
-      if (!strcmp (optarg, "warning"))
+      else if (!strcmp (optarg, "warning"))
         onredirect = STATE_WARNING;
-      if (!strcmp (optarg, "critical"))
+      else if (!strcmp (optarg, "critical"))
         onredirect = STATE_CRITICAL;
+      else usage2 (_("Invalid onredirect option"), optarg);
       if (verbose)
         printf(_("option f:%d \n"), onredirect);
       break;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list