summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS41
-rwxr-xr-xNP-VERSION-GEN2
-rw-r--r--README4
-rw-r--r--THANKS.in24
-rw-r--r--configure.ac2
-rw-r--r--doc/RELEASING.md28
-rw-r--r--plugins-root/check_icmp.c2
-rwxr-xr-xplugins-scripts/check_mailq.pl8
-rw-r--r--plugins/check_curl.c39
-rw-r--r--plugins/check_dns.c20
-rw-r--r--plugins/check_http.c15
11 files changed, 151 insertions, 34 deletions
diff --git a/NEWS b/NEWS
index 0848705..4061c03 100644
--- a/NEWS
+++ b/NEWS
@@ -1,17 +1,56 @@
1This file documents the major additions and syntax changes between releases. 1This file documents the major additions and syntax changes between releases.
2 2
32.3 [...] 32.4 [...]
4 ENHANCEMENTS
5
6 FIXES
7
82.3 10th December 2020
4 ENHANCEMENTS 9 ENHANCEMENTS
5 check_dns: allow 'expected address' (-a) to be specified in CIDR notation 10 check_dns: allow 'expected address' (-a) to be specified in CIDR notation
6 (IPv4 only). 11 (IPv4 only).
7 check_dns: allow for IPv6 RDNS 12 check_dns: allow for IPv6 RDNS
13 check_dns: Accept CIDR
8 check_dns: allow unsorted addresses 14 check_dns: allow unsorted addresses
9 check_dns: allow forcing complete match of all addresses 15 check_dns: allow forcing complete match of all addresses
10 check_apt: add --only-critical switch 16 check_apt: add --only-critical switch
11 check_apt: add -l/--list option to print packages 17 check_apt: add -l/--list option to print packages
18 check_file_age: add range checking
19 check_file_age: enable to test for maximum file size
20 check_apt: adding packages-warning option
21 check_load: Adding top consuming processes option
22 check_http: Adding Proxy-Authorization and extra headers
23 check_snmp: make calcualtion of timeout value in help output more clear
24 check_uptime: new plugin for checking uptime to see how long the system is running
25 check_curl: check_http replacement based on libcurl
26 check_http: Allow user to specify HTTP method after proxy CONNECT
27 check_http: Add new flag --show-body/-B to print body
28 check_cluster: Added data argument validation
29 check_icmp: Add IPv6 support
30 check_icmp: Automatically detect IP protocol
31 check_icmp: emit error if multiple protocol version
32 check_disk: add support to display inodes usage in perfdata
33 check_hpjd: Added -D option to disable warning on 'out of paper'
34 check_http: support the --show-body/-B flag when --expect is used
35 check_mysql: allow mariadbclient to be used
36 check_tcp: add --sni
37 check_dns: detect unreachable dns service in nslookup output
12 38
13 FIXES 39 FIXES
14 Fix regression where check_dhcp was rereading response in a tight loop 40 Fix regression where check_dhcp was rereading response in a tight loop
41 check_dns: fix error detection on sles nslookup
42 check_disk_smb: fix timeout issue
43 check_swap: repaired "-n" behaviour
44 check_icmp: Correctly set address_family on lookup
45 check_icmp: Do not overwrite -4,-6 on lookup
46 check_smtp: initializes n before it is used
47 check_dns: fix typo in parameter description
48 check_by_ssh: fix child process leak on timeouts
49 check_mysql: Allow sockets to be specified to -H
50 check_procs: improve command examples for 'at least' processes
51 check_swap: repaired "-n" behaviour
52 check_disk: include -P switch in help
53 check_mailq: restore accidentially removed options
15 54
162.2 29th November 2016 552.2 29th November 2016
17 ENHANCEMENTS 56 ENHANCEMENTS
diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN
index cf78d69..c353b1d 100755
--- a/NP-VERSION-GEN
+++ b/NP-VERSION-GEN
@@ -6,7 +6,7 @@
6SRC_ROOT=`dirname $0` 6SRC_ROOT=`dirname $0`
7 7
8NPVF=NP-VERSION-FILE 8NPVF=NP-VERSION-FILE
9DEF_VER=2.2.git 9DEF_VER=2.3git
10 10
11LF=' 11LF='
12' 12'
diff --git a/README b/README
index beb7769..71b4d37 100644
--- a/README
+++ b/README
@@ -10,7 +10,7 @@ Monitoring Plugins
10* For information on detailed changes that have been made or plugins 10* For information on detailed changes that have been made or plugins
11 that have been added, read the `ChangeLog` file. 11 that have been added, read the `ChangeLog` file.
12 12
13* Some plugins require that you have additional programs and/or 13* Some plugins require that you have additional programs or
14 libraries installed on your system before they can be used. Plugins that 14 libraries installed on your system before they can be used. Plugins that
15 are dependent on other programs/libraries that are missing are usually not 15 are dependent on other programs/libraries that are missing are usually not
16 compiled. Read the `REQUIREMENTS` file for more information. 16 compiled. Read the `REQUIREMENTS` file for more information.
@@ -19,7 +19,7 @@ Monitoring Plugins
19 the basic guidelines for development will provide detailed help when 19 the basic guidelines for development will provide detailed help when
20 invoked with the `-h` or `--help` options. 20 invoked with the `-h` or `--help` options.
21 21
22You can check for the latest plugins at: 22You can check the latest plugins at:
23 23
24* <https://www.monitoring-plugins.org/> 24* <https://www.monitoring-plugins.org/>
25 25
diff --git a/THANKS.in b/THANKS.in
index 9bb4382..7d1d1ff 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -357,3 +357,27 @@ Thomas Kurschel
357Yannick Charton 357Yannick Charton
358Nicolai Søborg 358Nicolai Søborg
359Rolf Eike Beer 359Rolf Eike Beer
360Bernd Arnold
361Andreas Baumann
362Tobias Wolf
363Lars Michelsen
364Vincent Danjean
365Kostyantyn Hushchyn
366Christian Tacke
367Alexander A. Klimov
368Vadim Zhukov
369Bernard Spil
370Christian Schmidt
371Guido Falsi
372Harald Koch
373Iustin Pop
374Jacob Hansen
375Jean-François Rameau
376Karol Babioch
377Lucas Bussey
378Marc Sánchez
379Markus Frosch
380Michael Kraus
381Patrick Rauscher
382Prathamesh Bhanuse
383Valentin Vidic
diff --git a/configure.ac b/configure.ac
index 4aebc2a..7c17dcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
1dnl Process this file with autoconf to produce a configure script. 1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.59) 2AC_PREREQ(2.59)
3AC_INIT(monitoring-plugins,2.2) 3AC_INIT(monitoring-plugins,2.3git)
4AC_CONFIG_SRCDIR(NPTest.pm) 4AC_CONFIG_SRCDIR(NPTest.pm)
5AC_CONFIG_FILES([gl/Makefile]) 5AC_CONFIG_FILES([gl/Makefile])
6AC_CONFIG_AUX_DIR(build-aux) 6AC_CONFIG_AUX_DIR(build-aux)
diff --git a/doc/RELEASING.md b/doc/RELEASING.md
index 1f9db07..bcd2c5a 100644
--- a/doc/RELEASING.md
+++ b/doc/RELEASING.md
@@ -11,14 +11,14 @@ Before you start
11 11
12- Check Travis CI status. 12- Check Travis CI status.
13- Update local Git repository to the current `master` tip. For a 13- Update local Git repository to the current `master` tip. For a
14 maintenance release (e.g., version 2.2.2), update to the current 14 maintenance release (e.g., version 2.3.2), update to the current
15 `maint-2.2` tip, instead. 15 `maint-2.3` tip, instead.
16 16
17Prepare and commit files 17Prepare and commit files
18------------------------ 18------------------------
19 19
20- Update `configure.ac` and `NP-VERSION-GEN` with new version. 20- Update `configure.ac` and `NP-VERSION-GEN` with new version.
21- Update `NEWS` from `git log --reverse v2.2.1..` output, and specify 21- Update `NEWS` from `git log --reverse v2.3.1..` output, and specify
22 the release version/date. 22 the release version/date.
23- Update `AUTHORS` if there are new team members. 23- Update `AUTHORS` if there are new team members.
24- Update `THANKS.in` using `tools/update-thanks`. 24- Update `THANKS.in` using `tools/update-thanks`.
@@ -29,27 +29,27 @@ Prepare and commit files
29Create annotated tag 29Create annotated tag
30-------------------- 30--------------------
31 31
32 git tag -a -m 'Monitoring Plugins 2.3' v2.3 32 git tag -a -m 'Monitoring Plugins 2.4' v2.4
33 33
34Push the code and tag to GitHub 34Push the code and tag to GitHub
35------------------------------- 35-------------------------------
36 36
37 git push monitoring-plugins master 37 git push monitoring-plugins master
38 git push monitoring-plugins v2.3 38 git push monitoring-plugins v2.4
39 39
40Create new maintenance branch 40Create new maintenance branch
41----------------------------- 41-----------------------------
42 42
43_Only necessary when creating a feature release._ 43_Only necessary when creating a feature release._
44 44
45 git checkout -b maint-2.3 v2.3 45 git checkout -b maint-2.4 v2.4
46 git push -u monitoring-plugins maint-2.3 46 git push -u monitoring-plugins maint-2.4
47 47
48Checkout new version 48Checkout new version
49-------------------- 49--------------------
50 50
51 rm -rf /tmp/plugins 51 rm -rf /tmp/plugins
52 git archive --prefix=tmp/plugins/ v2.3 | (cd /; tar -xf -) 52 git archive --prefix=tmp/plugins/ v2.4 | (cd /; tar -xf -)
53 53
54Build the tarball 54Build the tarball
55----------------- 55-----------------
@@ -62,26 +62,26 @@ Build the tarball
62Upload tarball to web site 62Upload tarball to web site
63-------------------------- 63--------------------------
64 64
65 scp monitoring-plugins-2.3.tar.gz \ 65 scp monitoring-plugins-2.4.tar.gz \
66 plugins@orwell.monitoring-plugins.org:web/download/ 66 plugins@orwell.monitoring-plugins.org:web/download/
67 67
68Generate SHA1 checksum file on web site 68Generate SHA1 checksum file on web site
69--------------------------------------- 69---------------------------------------
70 70
71 ssh plugins@orwell.monitoring-plugins.org \ 71 ssh plugins@orwell.monitoring-plugins.org \
72 '(cd web/download; $HOME/bin/create-checksum monitoring-plugins-2.3.tar.gz)' 72 '(cd web/download; $HOME/bin/create-checksum monitoring-plugins-2.4.tar.gz)'
73 73
74Announce new release 74Announce new release
75-------------------- 75--------------------
76 76
77- In the site.git repository: 77- In the site.git repository:
78 78
79 - Create `web/input/news/release-2-3.md`. 79 - Create `web/input/news/release-2-4.md`.
80 - Update the `plugins_release` version in `web/macros.py`. 80 - Update the `plugins_release` version in `web/macros.py`.
81 - Commit and push the result: 81 - Commit and push the result:
82 82
83 git add web/input/news/release-2-3.md 83 git add web/input/news/release-2-4.md
84 git commit web/input/news/release-2-3.md web/macros.py 84 git commit web/input/news/release-2-4.md web/macros.py
85 git push origin master 85 git push origin master
86 86
87- Post an announcement on (at least) the following mailing lists: 87- Post an announcement on (at least) the following mailing lists:
@@ -93,6 +93,6 @@ Announce new release
93 93
94If you want to mention the number of contributors in the announcement: 94If you want to mention the number of contributors in the announcement:
95 95
96 git shortlog -s v2.2.1..v2.3 | wc -l 96 git shortlog -s v2.3.1..v2.4 | wc -l
97 97
98<!-- vim:set filetype=markdown textwidth=72: --> 98<!-- vim:set filetype=markdown textwidth=72: -->
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index e45fdf6..31eb4c6 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -1134,7 +1134,7 @@ finish(int sig)
1134 while(host) { 1134 while(host) {
1135 if(!host->icmp_recv) { 1135 if(!host->icmp_recv) {
1136 /* rta 0 is ofcourse not entirely correct, but will still show up 1136 /* rta 0 is ofcourse not entirely correct, but will still show up
1137 * conspicuosly as missing entries in perfparse and cacti */ 1137 * conspicuously as missing entries in perfparse and cacti */
1138 pl = 100; 1138 pl = 100;
1139 rta = 0; 1139 rta = 0;
1140 status = STATE_CRITICAL; 1140 status = STATE_CRITICAL;
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl
index 32f498d..aac1310 100755
--- a/plugins-scripts/check_mailq.pl
+++ b/plugins-scripts/check_mailq.pl
@@ -568,7 +568,9 @@ sub process_arguments(){
568 "w=i" => \$opt_w, "warning=i" => \$opt_w, # warning if above this number 568 "w=i" => \$opt_w, "warning=i" => \$opt_w, # warning if above this number
569 "c=i" => \$opt_c, "critical=i" => \$opt_c, # critical if above this number 569 "c=i" => \$opt_c, "critical=i" => \$opt_c, # critical if above this number
570 "t=i" => \$opt_t, "timeout=i" => \$opt_t, 570 "t=i" => \$opt_t, "timeout=i" => \$opt_t,
571 "s" => \$opt_s, "sudo" => \$opt_s 571 "s" => \$opt_s, "sudo" => \$opt_s,
572 "W=i" => \$opt_W, # warning if above this number
573 "C=i" => \$opt_C, # critical if above this number
572 ); 574 );
573 575
574 if ($opt_V) { 576 if ($opt_V) {
@@ -662,8 +664,8 @@ sub print_help () {
662 print " Feedback/patches to support non-sendmail mailqueue welcome\n\n"; 664 print " Feedback/patches to support non-sendmail mailqueue welcome\n\n";
663 print "-w (--warning) = Min. number of messages in queue to generate warning\n"; 665 print "-w (--warning) = Min. number of messages in queue to generate warning\n";
664 print "-c (--critical) = Min. number of messages in queue to generate critical alert ( w < c )\n"; 666 print "-c (--critical) = Min. number of messages in queue to generate critical alert ( w < c )\n";
665 print "-W (--Warning) = Min. number of messages for same domain in queue to generate warning\n"; 667 print "-W = Min. number of messages for same domain in queue to generate warning\n";
666 print "-C (--Critical) = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n"; 668 print "-C = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n";
667 print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n"; 669 print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n";
668 print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect)\n"; 670 print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect)\n";
669 print "-s (--sudo) = Use sudo to call the mailq command\n"; 671 print "-s (--sudo) = Use sudo to call the mailq command\n";
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 2d69b31..8f274c2 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -296,6 +296,28 @@ CURLcode sslctxfun(CURL *curl, SSL_CTX *sslctx, void *parm)
296#endif /* USE_OPENSSL */ 296#endif /* USE_OPENSSL */
297#endif /* HAVE_SSL */ 297#endif /* HAVE_SSL */
298 298
299/* returns a string "HTTP/1.x" or "HTTP/2" */
300static char *string_statuscode (int major, int minor)
301{
302 static char buf[10];
303
304 switch (major) {
305 case 1:
306 snprintf (buf, sizeof (buf), "HTTP/%d.%d", major, minor);
307 break;
308 case 2:
309 case 3:
310 snprintf (buf, sizeof (buf), "HTTP/%d", major);
311 break;
312 default:
313 /* assuming here HTTP/N with N>=4 */
314 snprintf (buf, sizeof (buf), "HTTP/%d", major);
315 break;
316 }
317
318 return buf;
319}
320
299/* Checks if the server 'reply' is one of the expected 'statuscodes' */ 321/* Checks if the server 'reply' is one of the expected 'statuscodes' */
300static int 322static int
301expected_statuscode (const char *reply, const char *statuscodes) 323expected_statuscode (const char *reply, const char *statuscodes)
@@ -746,7 +768,8 @@ GOT_FIRST_CERT:
746 if (curlhelp_parse_statusline (header_buf.buf, &status_line) < 0) { 768 if (curlhelp_parse_statusline (header_buf.buf, &status_line) < 0) {
747 snprintf (msg, DEFAULT_BUFFER_SIZE, "Unparsable status line in %.3g seconds response time|%s\n", 769 snprintf (msg, DEFAULT_BUFFER_SIZE, "Unparsable status line in %.3g seconds response time|%s\n",
748 total_time, perfstring); 770 total_time, perfstring);
749 die (STATE_CRITICAL, "HTTP CRITICAL HTTP/1.x %ld unknown - %s", code, msg); 771 /* we cannot know the major/minor version here for sure as we cannot parse the first line */
772 die (STATE_CRITICAL, "HTTP CRITICAL HTTP/x.x %ld unknown - %s", code, msg);
750 } 773 }
751 774
752 /* get result code from cURL */ 775 /* get result code from cURL */
@@ -823,8 +846,8 @@ GOT_FIRST_CERT:
823 846
824 /* check status codes, set exit status accordingly */ 847 /* check status codes, set exit status accordingly */
825 if( status_line.http_code != code ) { 848 if( status_line.http_code != code ) {
826 die (STATE_CRITICAL, _("HTTP CRITICAL HTTP/%d.%d %d %s - different HTTP codes (cUrl has %ld)\n"), 849 die (STATE_CRITICAL, _("HTTP CRITICAL %s %d %s - different HTTP codes (cUrl has %ld)\n"),
827 status_line.http_major, status_line.http_minor, 850 string_statuscode (status_line.http_major, status_line.http_minor),
828 status_line.http_code, status_line.msg, code); 851 status_line.http_code, status_line.msg, code);
829 } 852 }
830 853
@@ -895,8 +918,8 @@ GOT_FIRST_CERT:
895 msg[strlen(msg)-3] = '\0'; 918 msg[strlen(msg)-3] = '\0';
896 919
897 /* TODO: separate _() msg and status code: die (result, "HTTP %s: %s\n", state_text(result), msg); */ 920 /* TODO: separate _() msg and status code: die (result, "HTTP %s: %s\n", state_text(result), msg); */
898 die (result, "HTTP %s: HTTP/%d.%d %d %s%s%s - %d bytes in %.3f second response time %s|%s\n", 921 die (result, "HTTP %s: %s %d %s%s%s - %d bytes in %.3f second response time %s|%s\n",
899 state_text(result), status_line.http_major, status_line.http_minor, 922 state_text(result), string_statuscode (status_line.http_major, status_line.http_minor),
900 status_line.http_code, status_line.msg, 923 status_line.http_code, status_line.msg,
901 strlen(msg) > 0 ? " - " : "", 924 strlen(msg) > 0 ? " - " : "",
902 msg, page_len, total_time, 925 msg, page_len, total_time,
@@ -1041,7 +1064,7 @@ redir (curlhelp_write_curlbuf* header_buf)
1041 const UriPathSegmentA* p = uri.pathHead; 1064 const UriPathSegmentA* p = uri.pathHead;
1042 for (; p; p = p->next) { 1065 for (; p; p = p->next) {
1043 strncat (new_url, "/", DEFAULT_BUFFER_SIZE); 1066 strncat (new_url, "/", DEFAULT_BUFFER_SIZE);
1044 strncat (new_url, uri_string (p->text, buf, DEFAULT_BUFFER_SIZE), DEFAULT_BUFFER_SIZE); 1067 strncat (new_url, uri_string (p->text, buf, DEFAULT_BUFFER_SIZE), DEFAULT_BUFFER_SIZE-1);
1045 } 1068 }
1046 } 1069 }
1047 1070
@@ -1354,7 +1377,7 @@ process_arguments (int argc, char **argv)
1354 ssl_version = CURL_SSLVERSION_DEFAULT; 1377 ssl_version = CURL_SSLVERSION_DEFAULT;
1355#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 52, 0) */ 1378#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 52, 0) */
1356 else 1379 else
1357 usage4 (_("Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2 (with optional '+' suffix)")); 1380 usage4 (_("Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2, 1.3 (with optional '+' suffix)"));
1358 } 1381 }
1359#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 54, 0) 1382#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 54, 0)
1360 if (got_plus) { 1383 if (got_plus) {
@@ -1659,7 +1682,7 @@ print_help (void)
1659 printf (" %s\n", "-S, --ssl=VERSION[+]"); 1682 printf (" %s\n", "-S, --ssl=VERSION[+]");
1660 printf (" %s\n", _("Connect via SSL. Port defaults to 443. VERSION is optional, and prevents")); 1683 printf (" %s\n", _("Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"));
1661 printf (" %s\n", _("auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,")); 1684 printf (" %s\n", _("auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,"));
1662 printf (" %s\n", _("1.2 = TLSv1.2). With a '+' suffix, newer versions are also accepted.")); 1685 printf (" %s\n", _("1.2 = TLSv1.2, 1.3 = TLSv1.3). With a '+' suffix, newer versions are also accepted."));
1663 printf (" %s\n", _("Note: SSLv2 and SSLv3 are deprecated and are usually disabled in libcurl")); 1686 printf (" %s\n", _("Note: SSLv2 and SSLv3 are deprecated and are usually disabled in libcurl"));
1664 printf (" %s\n", "--sni"); 1687 printf (" %s\n", "--sni");
1665 printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)")); 1688 printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)"));
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index b90f50e..0f2e654 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -473,9 +473,23 @@ process_arguments (int argc, char **argv)
473 case 'a': /* expected address */ 473 case 'a': /* expected address */
474 if (strlen (optarg) >= ADDRESS_LENGTH) 474 if (strlen (optarg) >= ADDRESS_LENGTH)
475 die (STATE_UNKNOWN, _("Input buffer overflow\n")); 475 die (STATE_UNKNOWN, _("Input buffer overflow\n"));
476 expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**)); 476 if (strchr(optarg, ',') != NULL) {
477 expected_address[expected_address_cnt] = strdup(optarg); 477 char *comma = strchr(optarg, ',');
478 expected_address_cnt++; 478 while (comma != NULL) {
479 expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**));
480 expected_address[expected_address_cnt] = strndup(optarg, comma - optarg);
481 expected_address_cnt++;
482 optarg = comma + 1;
483 comma = strchr(optarg, ',');
484 }
485 expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**));
486 expected_address[expected_address_cnt] = strdup(optarg);
487 expected_address_cnt++;
488 } else {
489 expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**));
490 expected_address[expected_address_cnt] = strdup(optarg);
491 expected_address_cnt++;
492 }
479 break; 493 break;
480 case 'A': /* expect authority */ 494 case 'A': /* expect authority */
481 expect_authority = TRUE; 495 expect_authority = TRUE;
diff --git a/plugins/check_http.c b/plugins/check_http.c
index de59a06..e2298b1 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -931,6 +931,21 @@ check_http (void)
931 931
932 if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst %s:%d\n", server_address, server_port, host_name, HTTPS_PORT); 932 if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst %s:%d\n", server_address, server_port, host_name, HTTPS_PORT);
933 asprintf (&buf, "%s %s:%d HTTP/1.1\r\n%s\r\n", http_method, host_name, HTTPS_PORT, user_agent); 933 asprintf (&buf, "%s %s:%d HTTP/1.1\r\n%s\r\n", http_method, host_name, HTTPS_PORT, user_agent);
934 if (strlen(proxy_auth)) {
935 base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
936 xasprintf (&buf, "%sProxy-Authorization: Basic %s\r\n", buf, auth);
937 }
938 /* optionally send any other header tag */
939 if (http_opt_headers_count) {
940 for (i = 0; i < http_opt_headers_count ; i++) {
941 if (force_host_header != http_opt_headers[i]) {
942 xasprintf (&buf, "%s%s\r\n", buf, http_opt_headers[i]);
943 }
944 }
945 /* This cannot be free'd here because a redirection will then try to access this and segfault */
946 /* Covered in a testcase in tests/check_http.t */
947 /* free(http_opt_headers); */
948 }
934 asprintf (&buf, "%sProxy-Connection: keep-alive\r\n", buf); 949 asprintf (&buf, "%sProxy-Connection: keep-alive\r\n", buf);
935 asprintf (&buf, "%sHost: %s\r\n", buf, host_name); 950 asprintf (&buf, "%sHost: %s\r\n", buf, host_name);
936 /* we finished our request, send empty line with CRLF */ 951 /* we finished our request, send empty line with CRLF */