--- apache2-2.2.3.orig/modules/mappers/mod_userdir.c 2006-07-12 05:38:44.000000000 +0200 +++ apache2-2.2.3/modules/mappers/mod_userdir.c 2008-06-27 11:22:45.129901954 +0200 @@ -245,12 +245,23 @@ while (*userdirs) { const char *userdir = ap_getword_conf(r->pool, &userdirs); - char *filename = NULL, *x = NULL; + char *filename = NULL, *x = NULL, *S = NULL, *s = NULL; apr_status_t rv; int is_absolute = ap_os_is_path_absolute(r->pool, userdir); - if (ap_strchr_c(userdir, '*')) - x = ap_getword(r->pool, &userdir, '*'); + if ((S = ap_strchr_c(userdir, '?')) && S < ap_strchr_c(userdir, '*')) { + // Get the characters until '?' + S = ap_getword(r->pool, &userdir, '?'); + // Copy the first letter of the username! + s= apr_pstrndup(r->pool, w, 1); + // Get the next characters until '*' (usally only '/') + x = ap_getword(r->pool, &userdir, '*'); + // Concat everything together. + x = apr_pstrcat(r->pool, S, s, x, NULL); + } else { + if (ap_strchr_c(userdir, '*')) + x = ap_getword(r->pool, &userdir, '*'); + } if (userdir[0] == '\0' || is_absolute) { if (x) {