SF.net SVN: nagiosplug: [1804] nagiosplug/trunk

[email protected]
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
Revision: 1804
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1804&view=rev
Author:   hweiss
Date:     2007-10-02 06:51:41 -0700 (Tue, 02 Oct 2007)

Log Message:
-----------
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@)

Modified Paths:
--------------
    nagiosplug/trunk/NEWS
    nagiosplug/trunk/plugins/check_http.c

Modified: nagiosplug/trunk/NEWS
===================================================================
--- nagiosplug/trunk/NEWS	2007-09-29 10:03:56 UTC (rev 1803)
+++ nagiosplug/trunk/NEWS	2007-10-02 13:51:41 UTC (rev 1804)
@@ -1,5 +1,9 @@
 This file documents the major additions and syntax changes between releases.
 
+1.4.11 or 1.5 ??
+	Fix check_http regression in 1.4.10 where following redirects to
+	  relative URLs on virtual hosts failed if both "-H" and "-I" were used
+
 1.4.10 28th September 2007
 	Fix check_http buffer overflow vulnerability when following HTTP redirects
 	check_http now explicitly asks HTTP/1.1 servers to close the connection

Modified: nagiosplug/trunk/plugins/check_http.c
===================================================================
--- nagiosplug/trunk/plugins/check_http.c	2007-09-29 10:03:56 UTC (rev 1803)
+++ nagiosplug/trunk/plugins/check_http.c	2007-10-02 13:51:41 UTC (rev 1804)
@@ -151,7 +151,7 @@
 
   if (display_html == TRUE)
     printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">", 
-      use_ssl ? "https" : "http", server_address,
+      use_ssl ? "https" : "http", host_name ? host_name : server_address,
       server_port, server_url);
 
   /* initialize alarm signal handling, set socket timeout, start timer */
@@ -1155,7 +1155,7 @@
       }
       i = server_port;
       strcpy (type, server_type);
-      strcpy (addr, server_address);
+      strcpy (addr, host_name ? host_name : server_address);
     }           
 
     else {
@@ -1204,8 +1204,8 @@
          display_html ? "</A>" : "");
 
   if (verbose)
-    printf (_("Redirection to %s://%s:%d%s\n"), server_type, server_address,
-            server_port, server_url);
+    printf (_("Redirection to %s://%s:%d%s\n"), server_type,
+            host_name ? host_name : server_address, server_port, server_url);
 
   check_http ();
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.