~ubuntu-branches/ubuntu/maverick/lighttpd/maverick

« back to all changes in this revision

Viewing changes to debian/patches/lighttpd-1.4.x_userdir_lowercase.patch

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2008-11-22 21:12:01 UTC
  • mfrom: (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20081122211201-lrmc15h29b6u3jjq
Tags: 1.4.19-5ubuntu1
* Merge from debian unstable, remaining changes:
 - debian/control: Depend on lsb >= 3.2-14, which has the
   status_of_proc() function; libgamin-dev rather than libfam-dev
   to fix startup warning
 - debian/init.d: Add the 'status' action, clean environment
 - debian/rules: set DEB_UPDATE_RCD_PARAMS to "defaults 91 09" to not
   start lighty before apache2 but in the same runlevel with the same
   priority
 - debian/index.html: s/Debian/Ubuntu/g branding on the default page
 - debian/compat: standards version 3.7.3, bump compat to 6, adjusted
   build-dep of debhelper accordingly
* Dropped changes
 - debian/lighttpd.install: all changes upstream now, order adjusted
   accordingly

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- src/mod_userdir.c.orig
 
2
+++ src/mod_userdir.c
 
3
@@ -262,6 +262,9 @@
 
4
                                return HANDLER_GO_ON;
 
5
                        }
 
6
                }
 
7
+               if (con->conf.force_lowercase_filenames) {
 
8
+                       buffer_to_lower(p->username);
 
9
+               }
 
10
 
 
11
                buffer_copy_string_buffer(p->temp_path, p->conf.basepath);
 
12
                BUFFER_APPEND_SLASH(p->temp_path);
 
13
@@ -284,8 +287,24 @@
 
14
                }
 
15
        }
 
16
 
 
17
+       /* the physical rel_path is basically the same as uri.path;
 
18
+        * but it is converted to lowercase in case of force_lowercase_filenames and some special handling
 
19
+        * for trailing '.', ' ' and '/' on windows
 
20
+        * we assume that no docroot/physical handler changed this
 
21
+        * (docroot should only set the docroot/server name, phyiscal should only change the phyiscal.path;
 
22
+        *  the exception mod_secure_download doesn't work with userdir anyway)
 
23
+        */
 
24
        BUFFER_APPEND_SLASH(p->temp_path);
 
25
-       buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
 
26
+       /* if no second '/' is found, we assume that it was stripped from the uri.path for the special handling
 
27
+        * on windows.
 
28
+        * we do not care about the trailing slash here on windows, as we already ensured it is a directory
 
29
+        *
 
30
+        * TODO: what to do with trailing dots in usernames on windows? they may result in the same directory
 
31
+        *       as a username without them.
 
32
+        */
 
33
+       if (NULL != (rel_url = strchr(con->physical.rel_path->ptr + 2, '/'))) {
 
34
+               buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
 
35
+       }
 
36
        buffer_copy_string_buffer(con->physical.path, p->temp_path);
 
37
 
 
38
        buffer_reset(p->temp_path);