~ubuntu-branches/debian/wheezy/apache2/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/077_CacheIgnoreURLSessionIdentifiers

  • Committer: Package Import Robot
  • Author(s): Stefan Fritsch, Stefan Fritsch, Arno Töll
  • Date: 2011-12-29 12:09:14 UTC
  • Revision ID: package-import@ubuntu.com-20111229120914-hv1j5bee6zhw8bjf
Tags: 2.2.21-4
[ Stefan Fritsch ]

* Security: Fix broken patch for CVE-2011-3607 (Integer overflow in
  ap_pregsub).
* Optimize debian/rules again to improve build time by doing most work in a
  single parallelized "build-%" target.

[ Arno Töll ]

* Fix "Suggest removing DefaultType from apache2.conf" change the DefaultType
  from text/plain to None. This lets the browser guess a proper MIME type
  instead of being forced to treat a given file according to our default type
  (Closes: #440058)
* Fix "add pre-rotate hook to logrotate script" execute scripts in
  /etc/logrotate.d/httpd-prerotate if available (Closes: #590096).
* Fix "Hide /icons index" Disables indexes on the icon directory. By upgrading
  to Debian's 3.0/quilt source format also images don't need to be generated
  at build time anymore. Hence, the icon date can no longer lead to
  information disclosure (Closes: #649888).
* Upgrade package to 3.0/quilt.
  + Remove uuencoded images, keep them in their binary format in debian/icons
  + Upgrade to quilt from dpatch and refresh all patches by keeping all hunks
    unchanged. Remove the `001_branding' patch by supplying -DPLATFORM at
    build time where needed Move the 200_cp_suexec.dpatch patch and
    202_suexec-custom.dpatch patch to debian/rules. 200_cp_suexec.dpatch was a
    script, not a patch which is not supported by quilt.
* Rewrite debian/rules and base it on dh(1).
  + use overrides where possible, replace some debhelper calls by our own
    implementation where needed. That's required since the Apache package is
    compiled in parts several times for each MPM once.
  + move some install operations to the their respective .install files
  + Support dpkg-buildflags now, which also enables by default hardening
    flags. Thus, remove them from their explicit appearance in debian/rules
  + Remove DEB_BUILD_OPTIONS legacy support. It comes for free when using
    dh(1)/dpkg-buildflags(1).
* Push debhelper compatibility to 8
* Remove unused Lintian overrides for the Debian source package remove and
  redundant priorities in debian/control.
* Add myself to Uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
##
 
3
## All lines beginning with `## DP:' are a description of the patch.
 
4
## DP: Fix CacheIgnoreURLSessionIdentifiers
 
5
## DP: r892289, r897705 from upstream svn. Debian bug #556383
 
6
 
 
7
@DPATCH@
 
8
--- a/modules/cache/cache_storage.c
 
9
+++ b/modules/cache/cache_storage.c
 
10
@@ -505,28 +505,60 @@
 
11
                 && (*(param + len + 1) == '=')
 
12
                 && !strchr(param + len + 2, '/')) {
 
13
                 path = apr_pstrndup(p, path, param - path);
 
14
-                break;
 
15
+                continue;
 
16
             }
 
17
             /*
 
18
              * Check if the identifier is in the querystring and cut it out.
 
19
              */
 
20
-            if (querystring
 
21
-                && (param = strstr(querystring, *identifier))
 
22
-                && (*(param + len) == '=')
 
23
-                ) {
 
24
-                char *amp;
 
25
-
 
26
-                if (querystring != param) {
 
27
-                    querystring = apr_pstrndup(p, querystring,
 
28
-                                               param - querystring);
 
29
+            if (querystring) {
 
30
+                /*
 
31
+                 * First check if the identifier is at the beginning of the
 
32
+                 * querystring and followed by a '='
 
33
+                 */
 
34
+                if (!strncmp(querystring, *identifier, len)
 
35
+                    && (*(querystring + len) == '=')) {
 
36
+                    param = querystring;
 
37
                 }
 
38
                 else {
 
39
-                    querystring = "";
 
40
+                    char *complete;
 
41
+
 
42
+                    /*
 
43
+                     * In order to avoid subkey matching (PR 48401) prepend
 
44
+                     * identifier with a '&' and append a '='
 
45
+                     */
 
46
+                    complete = apr_pstrcat(p, "&", *identifier, "=", NULL);
 
47
+                    param = strstr(querystring, complete);
 
48
+                    /* If we found something we are sitting on the '&' */
 
49
+                    if (param) {
 
50
+                        param++;
 
51
+                    }
 
52
                 }
 
53
-                if ((amp = strchr(param + len + 1, '&'))) {
 
54
-                    querystring = apr_pstrcat(p, querystring, amp + 1, NULL);
 
55
+                if (param) {
 
56
+                    char *amp;
 
57
+
 
58
+                    if (querystring != param) {
 
59
+                        querystring = apr_pstrndup(p, querystring,
 
60
+                                               param - querystring);
 
61
+                    }
 
62
+                    else {
 
63
+                        querystring = "";
 
64
+                    }
 
65
+
 
66
+                    if ((amp = strchr(param + len + 1, '&'))) {
 
67
+                        querystring = apr_pstrcat(p, querystring, amp + 1, NULL);
 
68
+                    }
 
69
+                    else {
 
70
+                        /*
 
71
+                         * If querystring is not "", then we have the case
 
72
+                         * that the identifier parameter we removed was the
 
73
+                         * last one in the original querystring. Hence we have
 
74
+                         * a trailing '&' which needs to be removed.
 
75
+                         */
 
76
+                        if (*querystring) {
 
77
+                            querystring[strlen(querystring) - 1] = '\0';
 
78
+                        }
 
79
+                    }
 
80
                 }
 
81
-                break;
 
82
             }
 
83
         }
 
84
     }