diff options
Diffstat (limited to 'web/attachments/152023-check_http.patch')
-rw-r--r-- | web/attachments/152023-check_http.patch | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/web/attachments/152023-check_http.patch b/web/attachments/152023-check_http.patch new file mode 100644 index 0000000..fa0b5c6 --- /dev/null +++ b/web/attachments/152023-check_http.patch | |||
@@ -0,0 +1,100 @@ | |||
1 | *** check_http.c.orig Mon Oct 10 21:00:43 2005 | ||
2 | --- check_http.c Mon Oct 10 21:09:02 2005 | ||
3 | *************** | ||
4 | *** 107,112 **** | ||
5 | --- 107,113 ---- | ||
6 | double critical_time = 0; | ||
7 | int check_critical_time = FALSE; | ||
8 | char user_auth[MAX_INPUT_BUFFER] = ""; | ||
9 | + char proxy_auth[MAX_INPUT_BUFFER] = ""; | ||
10 | int display_html = FALSE; | ||
11 | char *http_opt_headers; | ||
12 | int onredirect = STATE_OK; | ||
13 | *************** | ||
14 | *** 220,225 **** | ||
15 | --- 221,228 ---- | ||
16 | {"certificate", required_argument, 0, 'C'}, | ||
17 | {"useragent", required_argument, 0, 'A'}, | ||
18 | {"header", required_argument, 0, 'k'}, | ||
19 | + {"authorization", required_argument, 0, 'a'}, | ||
20 | + {"proxy-authorization", required_argument, 0, 'b'}, | ||
21 | {"no-body", no_argument, 0, 'N'}, | ||
22 | {"max-age", required_argument, 0, 'M'}, | ||
23 | {"content-type", required_argument, 0, 'T'}, | ||
24 | *************** | ||
25 | *** 246,252 **** | ||
26 | } | ||
27 | |||
28 | while (1) { | ||
29 | ! c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:T:I:a:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option); | ||
30 | if (c == -1 || c == EOF) | ||
31 | break; | ||
32 | |||
33 | --- 249,255 ---- | ||
34 | } | ||
35 | |||
36 | while (1) { | ||
37 | ! c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:T:I:a:b:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option); | ||
38 | if (c == -1 || c == EOF) | ||
39 | break; | ||
40 | |||
41 | *************** | ||
42 | *** 355,360 **** | ||
43 | --- 358,367 ---- | ||
44 | strncpy (user_auth, optarg, MAX_INPUT_BUFFER - 1); | ||
45 | user_auth[MAX_INPUT_BUFFER - 1] = 0; | ||
46 | break; | ||
47 | + case 'b': /* proxy-authorization info */ | ||
48 | + strncpy (proxy_auth, optarg, MAX_INPUT_BUFFER - 1); | ||
49 | + proxy_auth[MAX_INPUT_BUFFER - 1] = 0; | ||
50 | + break; | ||
51 | case 'P': /* HTTP POST data in URL encoded format */ | ||
52 | if (http_method || http_post_data) break; | ||
53 | http_method = strdup("POST"); | ||
54 | *************** | ||
55 | *** 835,840 **** | ||
56 | --- 842,854 ---- | ||
57 | asprintf (&buf, "%sAuthorization: Basic %s\r\n", buf, auth); | ||
58 | } | ||
59 | |||
60 | + /* optionally send the proxy authentication info */ | ||
61 | + if (strlen(proxy_auth)) { | ||
62 | + auth = base64 (proxy_auth, strlen (proxy_auth)); | ||
63 | + asprintf (&buf, "%sProxy-Authorization: Basic %s\r\n", buf, auth); | ||
64 | + } | ||
65 | + | ||
66 | + | ||
67 | /* either send http POST data */ | ||
68 | if (http_post_data) { | ||
69 | if (http_content_type) { | ||
70 | *************** | ||
71 | *** 1508,1513 **** | ||
72 | --- 1522,1529 ---- | ||
73 | printf (_("\ | ||
74 | -a, --authorization=AUTH_PAIR\n\ | ||
75 | Username:password on sites with basic authentication\n\ | ||
76 | + -b, --proxy-authorization=AUTH_PAIR\n\ | ||
77 | + Username:password on proxy-servers with basic authentication\n\ | ||
78 | -A, --useragent=STRING\n\ | ||
79 | String to be sent in http header as \"User Agent\"\n\ | ||
80 | -k, --header=STRING\n\ | ||
81 | *************** | ||
82 | *** 1565,1572 **** | ||
83 | printf ("\ | ||
84 | Usage: %s -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]\n\ | ||
85 | [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\ | ||
86 | ! [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\ | ||
87 | ! [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\ | ||
88 | ! [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] \n\ | ||
89 | [-M <age>] [-A string] [-k string]\n", progname); | ||
90 | } | ||
91 | --- 1581,1589 ---- | ||
92 | printf ("\ | ||
93 | Usage: %s -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]\n\ | ||
94 | [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\ | ||
95 | ! [-a auth] [-b auth] [-f <ok | warn | critcal | follow>] \n\ | ||
96 | ! [-e <expect>] [-s string] [-l] \n\ | ||
97 | ! [-r <regex> | -R <case-insensitive regex>] [-P string]\n\ | ||
98 | ! [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] \n\ | ||
99 | [-M <age>] [-A string] [-k string]\n", progname); | ||
100 | } | ||