Revision 2283 branches/lighttpd-1.4.x

src/mod_userdir.c (revision 2283)
262 262
				return HANDLER_GO_ON;
263 263
			}
264 264
		}
265
		if (con->conf.force_lowercase_filenames) {
266
			buffer_to_lower(p->username);
267
		}
265 268

  
266 269
		buffer_copy_string_buffer(p->temp_path, p->conf.basepath);
267 270
		BUFFER_APPEND_SLASH(p->temp_path);
......
284 287
		}
285 288
	}
286 289

  
290
	/* the physical rel_path is basically the same as uri.path;
291
	 * but it is converted to lowercase in case of force_lowercase_filenames and some special handling
292
	 * for trailing '.', ' ' and '/' on windows
293
	 * we assume that no docroot/physical handler changed this
294
	 * (docroot should only set the docroot/server name, phyiscal should only change the phyiscal.path;
295
	 *  the exception mod_secure_download doesn't work with userdir anyway)
296
	 */
287 297
	BUFFER_APPEND_SLASH(p->temp_path);
288
	buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
298
	/* if no second '/' is found, we assume that it was stripped from the uri.path for the special handling
299
	 * on windows.
300
	 * we do not care about the trailing slash here on windows, as we already ensured it is a directory
301
	 *
302
	 * TODO: what to do with trailing dots in usernames on windows? they may result in the same directory
303
	 *       as a username without them.
304
	 */
305
	if (NULL != (rel_url = strchr(con->physical.rel_path->ptr + 2, '/'))) {
306
		buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
307
	}
289 308
	buffer_copy_string_buffer(con->physical.path, p->temp_path);
290 309

  
291 310
	buffer_reset(p->temp_path);
NEWS (revision 2283)
52 52
  * decode url before matching in mod_rewrite (#1720)
53 53
  * fixed conditional patching of ldap filter (#1564)
54 54
  * Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server)
55
  * fixed bug with case-insensitive filenames in mod_userdir (#1589), spotted by "anders1"
55 56

  
56 57
- 1.4.19 - 2008-03-10
57 58

  
58 59

  

Also available in: Unified diff