View | Details | Raw Unified | Return to bug 45259
Collapse All | Expand All

(-)apache2-2.2.3.orig/modules/mappers/mod_userdir.c (-3 / +14 lines)
Lines 245-256 Link Here
245
245
246
    while (*userdirs) {
246
    while (*userdirs) {
247
        const char *userdir = ap_getword_conf(r->pool, &userdirs);
247
        const char *userdir = ap_getword_conf(r->pool, &userdirs);
248
        char *filename = NULL, *x = NULL;
248
        char *filename = NULL, *x = NULL, *S = NULL, *s = NULL;
249
        apr_status_t rv;
249
        apr_status_t rv;
250
        int is_absolute = ap_os_is_path_absolute(r->pool, userdir);
250
        int is_absolute = ap_os_is_path_absolute(r->pool, userdir);
251
251
252
        if (ap_strchr_c(userdir, '*'))
252
	if ((S = ap_strchr_c(userdir, '?')) && S < ap_strchr_c(userdir, '*')) {
253
            x = ap_getword(r->pool, &userdir, '*');
253
	    // Get the characters until '?'
254
	    S = ap_getword(r->pool, &userdir, '?');
255
	    // Copy the first letter of the username!
256
	    s= apr_pstrndup(r->pool, w, 1);
257
	    // Get the next characters until '*' (usally only '/')
258
	    x = ap_getword(r->pool, &userdir, '*');
259
	    // Concat everything together.
260
	    x = apr_pstrcat(r->pool, S, s, x, NULL);
261
	} else {
262
            if (ap_strchr_c(userdir, '*'))
263
	       x = ap_getword(r->pool, &userdir, '*');
264
	}
254
265
255
        if (userdir[0] == '\0' || is_absolute) {
266
        if (userdir[0] == '\0' || is_absolute) {
256
            if (x) {
267
            if (x) {

Return to bug 45259