summaryrefslogtreecommitdiffstats
path: root/web/attachments/111856-check_tcp.c.mismatch.diff
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/111856-check_tcp.c.mismatch.diff')
-rw-r--r--web/attachments/111856-check_tcp.c.mismatch.diff66
1 files changed, 66 insertions, 0 deletions
diff --git a/web/attachments/111856-check_tcp.c.mismatch.diff b/web/attachments/111856-check_tcp.c.mismatch.diff
new file mode 100644
index 0000000..d3a32c6
--- /dev/null
+++ b/web/attachments/111856-check_tcp.c.mismatch.diff
@@ -0,0 +1,66 @@
1--- check_tcp.c.orig Thu Dec 9 13:01:37 2004
2+++ check_tcp.c Thu Dec 9 16:52:52 2004
3@@ -97,6 +97,7 @@
4 int use_ssl = FALSE;
5 int sd = 0;
6 char *buffer;
7+int expect_mismatch_state = STATE_WARNING;
8
9
10
11@@ -333,7 +334,7 @@
12 if (verbose)
13 printf ("%d %d\n", i, (int)server_expect_count);
14 if (i >= (int)server_expect_count)
15- die (STATE_WARNING, _("Invalid response from host\n"));
16+ die (expect_mismatch_state, _("Unexpected response from host: %s\n"), status);
17 if (strstr (status, server_expect[i]))
18 break;
19 }
20@@ -416,6 +417,7 @@
21 {"jail", required_argument, 0, 'j'},
22 {"delay", required_argument, 0, 'd'},
23 {"refuse", required_argument, 0, 'r'},
24+ {"mismatch", required_argument, 0, 'M'},
25 {"use-ipv4", no_argument, 0, '4'},
26 {"use-ipv6", no_argument, 0, '6'},
27 {"verbose", no_argument, 0, 'v'},
28@@ -548,7 +550,17 @@
29 else if (!strncmp(optarg,"crit",4))
30 econn_refuse_state = STATE_CRITICAL;
31 else
32- usage (_("Refuse mut be one of ok, warn, crit\n"));
33+ usage (_("Refuse must be one of ok, warn, crit\n"));
34+ break;
35+ case 'M':
36+ if (!strncmp(optarg,"ok",2))
37+ expect_mismatch_state = STATE_OK;
38+ else if (!strncmp(optarg,"warn",4))
39+ expect_mismatch_state = STATE_WARNING;
40+ else if (!strncmp(optarg,"crit",4))
41+ expect_mismatch_state = STATE_CRITICAL;
42+ else
43+ usage (_("Mismatch must be one of ok, warn, crit\n"));
44 break;
45 case 'd':
46 if (is_intpos (optarg))
47@@ -764,6 +776,8 @@
48 printf (_("\
49 -r, --refuse=ok|warn|crit\n\
50 Accept tcp refusals with states ok, warn, crit (default: crit)\n\
51+ -M, --mismatch=ok|warn|crit\n\
52+ Accept expect mismatches with states ok, warn, crit (default: warn)\n\
53 -j, --jail\n\
54 Hide output from TCP socket\n\
55 -m, --maxbytes=INTEGER\n\
56@@ -798,8 +812,8 @@
57 Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\
58 [-s <send string>] [-e <expect string>] [-q <quit string>]\n\
59 [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\
60- [-r <refuse state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>]\n\
61- [-S <use SSL>]\n"), progname);
62+ [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]\n\
63+ [-D <days to cert expiry>] [-S <use SSL>]\n"), progname);
64 printf (" %s (-h|--help)\n", progname);
65 printf (" %s (-V|--version)\n", progname);
66 }