From 44fc00ac6a5db78858015dd72b623977a05aa3b5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 7 Mar 2002 22:36:07 +0000 Subject: [PATCH] Need to check if the userdir is absolute before it gets split apart by ap_getword() Also fixed up the !HAVE_DRIVE_LETTERS case (such as NetWare) where the volume delimiter ( colon ) is not in an absolute position. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93780 13f79535-47bb-0310-9956-ffa450edef68 --- modules/mappers/mod_userdir.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/mappers/mod_userdir.c b/modules/mappers/mod_userdir.c index 82042fb6ec..806451ecd7 100644 --- a/modules/mappers/mod_userdir.c +++ b/modules/mappers/mod_userdir.c @@ -275,11 +275,12 @@ static int translate_userdir(request_rec *r) const char *userdir = ap_getword_conf(r->pool, &userdirs); char *filename = 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 (userdir[0] == '\0' || ap_os_is_path_absolute(r->pool, userdir)) { + if (userdir[0] == '\0' || is_absolute) { if (x) { #ifdef HAVE_DRIVE_LETTERS /* @@ -288,14 +289,12 @@ static int translate_userdir(request_rec *r) * know of no protocols that are a single letter, ignore * a : as the first or second character, and assume a file * was specified - * - * XXX: Still no good for NETWARE, since : is embedded (sys:/home) */ if (strchr(x + 2, ':')) #else - if (strchr(x, ':')) + if (strchr(x, ':') && !is_absolute) #endif /* HAVE_DRIVE_LETTERS */ - { + { redirect = apr_pstrcat(r->pool, x, w, userdir, dname, NULL); apr_table_setn(r->headers_out, "Location", redirect); return HTTP_MOVED_TEMPORARILY; -- 2.40.0