Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 1995 invoked by uid 500); 9 Oct 2001 17:58:54 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 1981 invoked by uid 500); 9 Oct 2001 17:58:54 -0000 Delivered-To: apmail-apache-1.3-cvs@apache.org Date: 9 Oct 2001 17:54:53 -0000 Message-ID: <20011009175453.41779.qmail@icarus.apache.org> From: wrowe@apache.org To: apache-1.3-cvs@apache.org Subject: cvs commit: apache-1.3/src/modules/standard mod_userdir.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N wrowe 01/10/09 10:54:53 Modified: src/modules/standard mod_userdir.c Log: Parse individual paths listed in the UserDir directive for correctness. This also addresses the 'quote' problem, where quoted paths would fail the is absolute redirect or absolute path test on Netware/Win32, given a "/somepath" designation. PR: 8238 Submitted by: Dustin Mitchell Revision Changes Path 1.51 +14 -9 apache-1.3/src/modules/standard/mod_userdir.c Index: mod_userdir.c =================================================================== RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_userdir.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- mod_userdir.c 2001/06/11 13:43:46 1.50 +++ mod_userdir.c 2001/10/09 17:54:53 1.51 @@ -166,21 +166,26 @@ } else { /* - * If the first (only?) value isn't one of our keywords, just copy - * the string to the userdir string. + * If the first (only?) value isn't one of our keywords, look at each + * config 'word' for validity and copy the entire arg to the userdir + * if all paths are valid. */ - if (!ap_os_is_path_absolute(arg) && !strchr(arg, ':')) + char *userdirs = arg; + while (*userdirs) { + char *thisdir = ap_getword_conf(cmd->pool, &userdirs); + if (!ap_os_is_path_absolute(thisdir) && !strchr(thisdir, ':')) #if defined(WIN32) || defined(NETWARE) - return "UserDir must specify an absolute redirect or absolute " - "file path"; + return "UserDir must specify an absolute redirect " + "or absolute file path"; #else - if (strchr(arg, '*')) - return "UserDir cannot specify '*' substitution within a " - "relative path"; + if (strchr(thisdir, '*')) + return "UserDir cannot specify '*' substitution within " + "a relative path"; #endif + } s_cfg->userdir = ap_pstrdup(cmd->pool, arg); #if defined(WIN32) || defined(OS2) || defined(NETWARE) - /* This is an incomplete path, so we cannot canonicalize it yet. + /* These are incomplete paths, so we cannot canonicalize them yet. * but any backslashes will confuse the parser, later, so simply * change them to slash form. */