Commit 217b59b3 authored by Colm MacCarthaigh's avatar Colm MacCarthaigh
Browse files

Merge r179622 and r280114 from trunk:

* mod_mime_magic: Handle CRLF-format magic files so that it works with
  the default installation on Windows.

* rewrite CR mitigation logic to wipe out any trailing
  white space

Suggested by: wrowe
Submitted by: trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@371646 13f79535-47bb-0310-9956-ffa450edef68
parent 3013796f
Loading
Loading
Loading
Loading
+3 −0
Changes for CHANGES: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.0.56
  *) mod_mime_magic: Handle CRLF-format magic files so that it works with
     the default installation on Windows.  [Jeff Trawick]
  *) Write message to error log if AuthGroupFile cannot be opened.
     PR 37566.  [Rüdiger Plüm]
+0 −8
Changes for STATUS: 0 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -133,14 +133,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
         http://svn.apache.org/viewcvs?view=rev&rev=154319
       +1: stoddard, striker, wrowe (as corrected in subsequent patches)

    *) mod_mime_magic: Handle CRLF-format^H^H^H^H^H^H^H magic files 
       with any trailing whitespace so that it works with the
       default installation on Windows.
       http://svn.apache.org/viewcvs?rev=179622&view=rev
       http://svn.apache.org/viewcvs?rev=280114&view=rev
       +1: trawick, wrowe, colm
        backported 280114 to 2.2.x branch already

    *) mod_dav: Fix a null pointer dereference in an error code path during the
       handling of MKCOL.
       Trunk version of patch:
+8 −3
Changes for modules/metadata/mod_mime_magic.c: 8 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -947,10 +947,15 @@ static int apprentice(server_rec *s, apr_pool_t *p)
    /* parse it */
    for (lineno = 1; apr_file_gets(line, BUFSIZ, f) == APR_SUCCESS; lineno++) {
	int ws_offset;
        char *last = line + strlen(line) - 1; /* guaranteed that len >= 1 since an
                                               * "empty" line contains a '\n'
                                               */

	/* delete newline */
	if (line[0]) {
	    line[strlen(line) - 1] = '\0';
	/* delete newline and any other trailing whitespace */
        while (last >= line
               && apr_isspace(*last)) {
            *last = '\0';
            --last;
        }
        
	/* skip leading whitespace */