~clint-fewbar/ubuntu/maverick/apache2/maverick-passphrase-plymouth-change

« back to all changes in this revision

Viewing changes to debian/patches/044_no_error_truncation.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Fritsch, Stefan Fritsch, Peter Samuelson
  • Date: 2007-07-01 19:57:51 UTC
  • mfrom: (0.8.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070701195751-kcags6dpm5up3li5
Tags: 2.2.4-1
[ Stefan Fritsch ]
* Urgency medium for security fix
* Fix CVE-2007-1863: DoS in mod_cache
* New upstream version (Closes: #427050)
  - Fixes "proxy: error reading status line from remote server"
    (Closes: #410331)
* Fix CVE-2007-1862: mod_mem_cache DoS (introduced in 2.2.4)
* Change logrotate script to use reload instead of restart.
  (Closes: #298689)
* chmod o-rx /var/log/apache2 (Closes: #291841)
* chmod o-x suexec (Closes: #431048)
* Update patch for truncated mod_cgi 500 responses from upstream SVN
  (Closes: #412580)
* Don't use AddDefaultCharset for our docs (Closes: #414429)
* fix options syntax in sites-available/default (Closes: #419539)
* Move conf.d include to the end of apache2.conf (Closes: #305933)
* Remove log, cache, and lock files on purge (Closes: #428887)
* Ship /usr/lib/cgi-bin (Closes: #415698)
* Add note to README.Debian how to read docs (Closes: #350822)
* Document pid file name (Closes: #350286)
* Update Standards-Version (no changes needed)
* Fix some lintian warnings, add some overrides
* Start apache when doing a "restart" even if it was not running
  (Closes: #384682)
* reload config in apache2-doc postinst (Closes: #289289)
* don't fail in prerm if apache is not running (Closes: #418536)
* Suggest apache2-doc and www-browser (Closes: #399056)
* Make init script always display a warning if NO_START=1 since
  VERBOSE=yes is not the default anymore (Closes: #430116)
* Replace apache2(8) man page with a more current version
* Add httxt2dbm(8) man page
* Show -X option in help message (Closes: #391817)
* remove sick-hack-to-update-modules
* don't depend on procps on hurd (Closes: #431125)

[ Peter Samuelson ]
* Add shlibs:Depends to apache2.2-common.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## no_error_truncation.dpatch by Tim Retout <tim@retout.co.uk>
 
2
## no_error_truncation.dpatch
 
3
## http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_cgi.c?r1=541926&r2=541990
3
4
##
4
5
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: Patch to stop errors being truncated when using mod_cgi. Taken from 
 
6
## DP: Patch to stop errors being truncated when using mod_cgi. See
6
7
## DP: http://issues.apache.org/bugzilla/show_bug.cgi?id=39710
 
8
## DP: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_cgi.c?r1=541926&r2=541990
7
9
 
8
10
@DPATCH@
9
 
 
10
 
diff -ru apache2-2.2.3.orig/modules/generators/mod_cgi.c apache2-2.2.3/modules/generators/mod_cgi.c
11
 
--- apache2-2.2.3.orig/modules/generators/mod_cgi.c     2006-07-12 04:38:44.000000000 +0100
12
 
+++ apache2-2.2.3/modules/generators/mod_cgi.c  2007-04-27 23:43:20.000000000 +0100
13
 
@@ -922,18 +922,7 @@
14
 
         int ret;
15
 
 
 
11
diff -urNad apache2-work~/modules/generators/mod_cgi.c apache2-work/modules/generators/mod_cgi.c
 
12
--- apache2-work~/modules/generators/mod_cgi.c  2007-06-11 20:00:30.000000000 +0200
 
13
+++ apache2-work/modules/generators/mod_cgi.c   2007-06-11 20:04:38.000000000 +0200
 
14
@@ -924,14 +924,30 @@
16
15
         if ((ret = ap_scan_script_header_err_brigade(r, bb, sbuf))) {
17
 
-            ret = log_script(r, conf, ret, dbuf, sbuf, bb, script_err);
18
 
-
 
16
             ret = log_script(r, conf, ret, dbuf, sbuf, bb, script_err);
 
17
 
19
18
-            /* Set our status. */
20
19
-            r->status = ret;
21
20
-
24
23
-            b = apr_bucket_eos_create(c->bucket_alloc);
25
24
-            APR_BRIGADE_INSERT_TAIL(bb, b);
26
25
-            ap_pass_brigade(r->output_filters, bb);
27
 
-
28
 
-            return ret;
29
 
+            return log_script(r, conf, ret, dbuf, sbuf, bb, script_err);
 
26
+            /*
 
27
+             * ret could be HTTP_NOT_MODIFIED in the case that the CGI script
 
28
+             * does not set an explicit status and ap_meets_conditions, which
 
29
+             * is called by ap_scan_script_header_err_brigade, detects that
 
30
+             * the conditions of the requests are met and the response is
 
31
+             * not modified.
 
32
+             * In this case set r->status and return OK in order to prevent
 
33
+             * running through the error processing stack as this would
 
34
+             * break with mod_cache, if the conditions had been set by
 
35
+             * mod_cache itself to validate a stale entity.
 
36
+             * BTW: We circumvent the error processing stack anyway if the
 
37
+             * CGI script set an explicit status code (whatever it is) and
 
38
+             * the only possible values for ret here are:
 
39
+             *
 
40
+             * HTTP_NOT_MODIFIED          (set by ap_meets_conditions)
 
41
+             * HTTP_PRECONDITION_FAILED   (set by ap_meets_conditions)
 
42
+             * HTTP_INTERNAL_SERVER_ERROR (if something went wrong during the
 
43
+             * processing of the response of the CGI script, e.g broken headers
 
44
+             * or a crashed CGI process).
 
45
+             */
 
46
+            if (ret == HTTP_NOT_MODIFIED) {
 
47
+                r->status = ret;
 
48
+                return OK;
 
49
+            }
 
50
 
 
51
             return ret;
30
52
         }
31
 
 
32
 
         location = apr_table_get(r->headers_out, "Location");