httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apache-1.3/src/modules/standard mod_userdir.c
Date Tue, 09 Oct 2001 17:54:53 GMT
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 <dustin@cs.uchicago.edu>
  
  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.
            */
  
  
  

Mime
View raw message