summaryrefslogtreecommitdiffstats
path: root/web/attachments/343854-check_http.patch
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/343854-check_http.patch')
-rw-r--r--web/attachments/343854-check_http.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/web/attachments/343854-check_http.patch b/web/attachments/343854-check_http.patch
new file mode 100644
index 0000000..d07b5d0
--- /dev/null
+++ b/web/attachments/343854-check_http.patch
@@ -0,0 +1,69 @@
1--- check_http.c.orig 2009-09-21 17:39:44.000000000 -0700
2+++ check_http.c 2009-09-21 17:32:14.000000000 -0700
3@@ -105,6 +105,7 @@
4 double critical_time = 0;
5 int check_critical_time = FALSE;
6 char user_auth[MAX_INPUT_BUFFER] = "";
7+char proxy_auth[MAX_INPUT_BUFFER] = "";
8 int display_html = FALSE;
9 char **http_opt_headers;
10 int http_opt_headers_count = 0;
11@@ -192,6 +193,7 @@
12 {"url", required_argument, 0, 'u'},
13 {"port", required_argument, 0, 'p'},
14 {"authorization", required_argument, 0, 'a'},
15+ {"proxy_authorization", required_argument, 0, 'b'},
16 {"string", required_argument, 0, 's'},
17 {"expect", required_argument, 0, 'e'},
18 {"regex", required_argument, 0, 'r'},
19@@ -229,7 +231,7 @@
20 }
21
22 while (1) {
23- c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option);
24+ c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option);
25 if (c == -1 || c == EOF)
26 break;
27
28@@ -350,6 +352,10 @@
29 strncpy (user_auth, optarg, MAX_INPUT_BUFFER - 1);
30 user_auth[MAX_INPUT_BUFFER - 1] = 0;
31 break;
32+ case 'b': /* proxy-authorization info */
33+ strncpy (proxy_auth, optarg, MAX_INPUT_BUFFER - 1);
34+ proxy_auth[MAX_INPUT_BUFFER - 1] = 0;
35+ break;
36 case 'P': /* HTTP POST data in URL encoded format; ignored if settings already */
37 if (! http_post_data)
38 http_post_data = strdup (optarg);
39@@ -836,6 +842,12 @@
40 asprintf (&buf, "%sAuthorization: Basic %s\r\n", buf, auth);
41 }
42
43+ /* optionally send the proxy authentication info */
44+ if (strlen(proxy_auth)) {
45+ base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
46+ asprintf (&buf, "%sProxy-Authorization: Basic %s\r\n", buf, auth);
47+ }
48+
49 /* either send http POST data (any data, not only POST)*/
50 if (http_post_data) {
51 if (http_content_type) {
52@@ -1346,6 +1358,8 @@
53
54 printf (" %s\n", "-a, --authorization=AUTH_PAIR");
55 printf (" %s\n", _("Username:password on sites with basic authentication"));
56+ printf (" %s\n", "-b, --proxy-authorization=AUTH_PAIR");
57+ printf (" %s\n", _("Username:password on proxy-servers with basic authentication"));
58 printf (" %s\n", "-A, --useragent=STRING");
59 printf (" %s\n", _("String to be sent in http header as \"User Agent\""));
60 printf (" %s\n", "-k, --header=STRING");
61@@ -1407,7 +1421,7 @@
62 printf (_("Usage:"));
63 printf (" %s -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]\n",progname);
64 printf (" [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n");
65- printf (" [-a auth] [-f <ok | warn | critcal | follow | sticky | stickyport>]\n");
66+ printf (" [-a auth] [-b proxy_auth] [-f <ok | warn | critcal | follow | sticky | stickyport>]\n");
67 printf (" [-e <expect>] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n");
68 printf (" [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]\n");
69 printf (" [-A string] [-k string] [-S] [-C <age>] [-T <content-type>] [-j method]\n");