1
#! /bin/sh /usr/share/dpatch/dpatch-run
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
8
--- a/modules/cache/cache_storage.c
9
+++ b/modules/cache/cache_storage.c
11
&& (*(param + len + 1) == '=')
12
&& !strchr(param + len + 2, '/')) {
13
path = apr_pstrndup(p, path, param - path);
18
* Check if the identifier is in the querystring and cut it out.
21
- && (param = strstr(querystring, *identifier))
22
- && (*(param + len) == '=')
26
- if (querystring != param) {
27
- querystring = apr_pstrndup(p, querystring,
28
- param - querystring);
31
+ * First check if the identifier is at the beginning of the
32
+ * querystring and followed by a '='
34
+ if (!strncmp(querystring, *identifier, len)
35
+ && (*(querystring + len) == '=')) {
36
+ param = querystring;
43
+ * In order to avoid subkey matching (PR 48401) prepend
44
+ * identifier with a '&' and append a '='
46
+ complete = apr_pstrcat(p, "&", *identifier, "=", NULL);
47
+ param = strstr(querystring, complete);
48
+ /* If we found something we are sitting on the '&' */
53
- if ((amp = strchr(param + len + 1, '&'))) {
54
- querystring = apr_pstrcat(p, querystring, amp + 1, NULL);
58
+ if (querystring != param) {
59
+ querystring = apr_pstrndup(p, querystring,
60
+ param - querystring);
66
+ if ((amp = strchr(param + len + 1, '&'))) {
67
+ querystring = apr_pstrcat(p, querystring, amp + 1, NULL);
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.
77
+ querystring[strlen(querystring) - 1] = '\0';