1
--- src/mod_userdir.c.orig
7
+ if (con->conf.force_lowercase_filenames) {
8
+ buffer_to_lower(p->username);
11
buffer_copy_string_buffer(p->temp_path, p->conf.basepath);
12
BUFFER_APPEND_SLASH(p->temp_path);
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)
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
28
+ * we do not care about the trailing slash here on windows, as we already ensured it is a directory
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.
33
+ if (NULL != (rel_url = strchr(con->physical.rel_path->ptr + 2, '/'))) {
34
+ buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
36
buffer_copy_string_buffer(con->physical.path, p->temp_path);
38
buffer_reset(p->temp_path);