diff options
author | Holger Weiss <hweiss@users.sourceforge.net> | 2007-10-02 13:51:41 +0000 |
---|---|---|
committer | Holger Weiss <hweiss@users.sourceforge.net> | 2007-10-02 13:51:41 +0000 |
commit | 604da4939252620a6c35f5f3f5703eb9e42e65bc (patch) | |
tree | d9d489ea9b4603f145c356039f5f455a1113e149 | |
parent | 488e20226d23ead29848196272d090ae921c1a59 (diff) | |
download | monitoring-plugins-604da4939252620a6c35f5f3f5703eb9e42e65bc.tar.gz |
Fix regression in 1.4.10 where following redirects to relative URLs on
virtual hosts failed if both "-H" and "-I" were specified (noted by
Rodrigo A. G. Schichaschwili on nagiosplug-devel@)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1804 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | plugins/check_http.c | 8 |
2 files changed, 8 insertions, 4 deletions
@@ -1,5 +1,9 @@ | |||
1 | This file documents the major additions and syntax changes between releases. | 1 | This file documents the major additions and syntax changes between releases. |
2 | 2 | ||
3 | 1.4.11 or 1.5 ?? | ||
4 | Fix check_http regression in 1.4.10 where following redirects to | ||
5 | relative URLs on virtual hosts failed if both "-H" and "-I" were used | ||
6 | |||
3 | 1.4.10 28th September 2007 | 7 | 1.4.10 28th September 2007 |
4 | Fix check_http buffer overflow vulnerability when following HTTP redirects | 8 | Fix check_http buffer overflow vulnerability when following HTTP redirects |
5 | check_http now explicitly asks HTTP/1.1 servers to close the connection | 9 | check_http now explicitly asks HTTP/1.1 servers to close the connection |
diff --git a/plugins/check_http.c b/plugins/check_http.c index b371cd64..24819359 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -151,7 +151,7 @@ main (int argc, char **argv) | |||
151 | 151 | ||
152 | if (display_html == TRUE) | 152 | if (display_html == TRUE) |
153 | printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">", | 153 | printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">", |
154 | use_ssl ? "https" : "http", server_address, | 154 | use_ssl ? "https" : "http", host_name ? host_name : server_address, |
155 | server_port, server_url); | 155 | server_port, server_url); |
156 | 156 | ||
157 | /* initialize alarm signal handling, set socket timeout, start timer */ | 157 | /* initialize alarm signal handling, set socket timeout, start timer */ |
@@ -1155,7 +1155,7 @@ redir (char *pos, char *status_line) | |||
1155 | } | 1155 | } |
1156 | i = server_port; | 1156 | i = server_port; |
1157 | strcpy (type, server_type); | 1157 | strcpy (type, server_type); |
1158 | strcpy (addr, server_address); | 1158 | strcpy (addr, host_name ? host_name : server_address); |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | else { | 1161 | else { |
@@ -1204,8 +1204,8 @@ redir (char *pos, char *status_line) | |||
1204 | display_html ? "</A>" : ""); | 1204 | display_html ? "</A>" : ""); |
1205 | 1205 | ||
1206 | if (verbose) | 1206 | if (verbose) |
1207 | printf (_("Redirection to %s://%s:%d%s\n"), server_type, server_address, | 1207 | printf (_("Redirection to %s://%s:%d%s\n"), server_type, |
1208 | server_port, server_url); | 1208 | host_name ? host_name : server_address, server_port, server_url); |
1209 | 1209 | ||
1210 | check_http (); | 1210 | check_http (); |
1211 | } | 1211 | } |