[Pkg-apache-commits] r1103 - in /trunk/apache2: changelog patches/00list patches/075_mod_rewrite_literal_ipv6_redirect.dpatch

sf at alioth.debian.org sf at alioth.debian.org
Sat Dec 5 23:16:29 UTC 2009


Author: sf
Date: Sat Dec  5 23:16:29 2009
New Revision: 1103

URL: http://svn.debian.org/wsvn/pkg-apache/?sc=1&rev=1103
Log:
mod_rewrite: Fix URLs in redirects with literal IPv6 hosts

Added:
    trunk/apache2/patches/075_mod_rewrite_literal_ipv6_redirect.dpatch   (with props)
Modified:
    trunk/apache2/changelog
    trunk/apache2/patches/00list

Modified: trunk/apache2/changelog
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/changelog?rev=1103&op=diff
==============================================================================
--- trunk/apache2/changelog (original)
+++ trunk/apache2/changelog Sat Dec  5 23:16:29 2009
@@ -1,5 +1,7 @@
 apache2 (2.2.14-4) UNRELEASED; urgency=low
 
+  * mod_rewrite: Fix URLs in redirects with literal IPv6 hosts
+    (closes: #557015).
   * Automatically listen on port 443 if mod_gnutls is loaded (closes: #558234).
   * Link with -lcrypt where necessary to fix a FTBFS with binutils-gold
     (closes: #553946).

Modified: trunk/apache2/patches/00list
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/patches/00list?rev=1103&op=diff
==============================================================================
--- trunk/apache2/patches/00list (original)
+++ trunk/apache2/patches/00list Sat Dec  5 23:16:29 2009
@@ -24,6 +24,7 @@
 072_CVE-2009-3555.dpatch
 073_mod_dav_trunk_fixes.dpatch
 074_link_support_progs_with_lcrypt.dpatch
+075_mod_rewrite_literal_ipv6_redirect.dpatch
 099_config_guess_sub_update
 200_cp_suexec.dpatch
 201_build_suexec-custom.dpatch

Added: trunk/apache2/patches/075_mod_rewrite_literal_ipv6_redirect.dpatch
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/patches/075_mod_rewrite_literal_ipv6_redirect.dpatch?rev=1103&op=file
==============================================================================
--- trunk/apache2/patches/075_mod_rewrite_literal_ipv6_redirect.dpatch (added)
+++ trunk/apache2/patches/075_mod_rewrite_literal_ipv6_redirect.dpatch Sat Dec  5 23:16:29 2009
@@ -1,0 +1,52 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 075_mod_rewrite_literal_ipv6_redirect.dpatch by Stefan Fritsch <sf at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add [] to literal ipv6 hosts in URLs (bug #557015)
+
+ at DPATCH@
+diff -urNad trunk~/modules/mappers/mod_rewrite.c trunk/modules/mappers/mod_rewrite.c
+--- trunk~/modules/mappers/mod_rewrite.c	2009-07-10 14:20:45.000000000 +0200
++++ trunk/modules/mappers/mod_rewrite.c	2009-12-06 00:10:57.468047872 +0100
+@@ -833,6 +833,23 @@
+ }
+ 
+ /*
++ * Get the current server name from the request for the purposes
++ * of using in a URL.  If the server name is an IPv6 literal
++ * address, it will be returned in URL format (e.g., "[fe80::1]").
++ */
++static const char *get_server_name_for_url(request_rec *r)
++{
++    const char *plain_server_name = ap_get_server_name(r);
++
++#if APR_HAVE_IPV6
++    if (ap_strchr_c(plain_server_name, ':')) { /* IPv6 literal? */
++        return apr_psprintf(r->pool, "[%s]", plain_server_name);
++    }
++#endif
++    return plain_server_name;
++}
++
++/*
+  * add 'http[s]://ourhost[:ourport]/' to URI
+  * if URI is still not fully qualified
+  */
+@@ -843,7 +860,7 @@
+         char *thisport;
+         int port;
+ 
+-        thisserver = ap_get_server_name(r);
++        thisserver = ap_get_server_name_for_url(r);
+         port = ap_get_server_port(r);
+         thisport = ap_is_default_port(port, r)
+                    ? ""
+@@ -4271,7 +4288,7 @@
+      */
+ 
+     /* add the canonical URI of this URL */
+-    thisserver = ap_get_server_name(r);
++    thisserver = ap_get_server_name_for_url(r);
+     port = ap_get_server_port(r);
+     if (ap_is_default_port(port, r)) {
+         thisport = "";

Propchange: trunk/apache2/patches/075_mod_rewrite_literal_ipv6_redirect.dpatch
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-apache-commits mailing list