dgaudet     98/03/12 23:12:56

  Modified:    src/main http_protocol.c
  Log:
  Move this ugly platform specific code from parse_uri_components() into
  parse_uri().  Guys this is probably something that should be done
  elsewhere.  Like maybe in directory_walk().
  
  Revision  Changes    Path
  1.196     +16 -0     apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.195
  retrieving revision 1.196
  diff -u -r1.195 -r1.196
  --- http_protocol.c   1998/03/10 06:13:50     1.195
  +++ http_protocol.c   1998/03/13 07:12:54     1.196
  @@ -594,6 +594,22 @@
        r->args = r->parsed_uri.query;
        r->uri = r->parsed_uri.path ? r->parsed_uri.path
                                    : pstrdup(r->pool, "/");
  +#if defined(__EMX__) || defined(WIN32)
  +     /* Handle path translations for OS/2 and plug security hole.
  +      * This will prevent "http://www.wherever.com/..\..\/"; from
  +      * returning a directory for the root drive.
  +      */
  +     {
  +         char *x;
  +
  +         for (x = r->uri; (x = strchr(x, '\\')) != NULL; )
  +             *x = '/';
  +#ifndef WIN32   /* for OS/2 only: */
  +         /* Fix OS/2 HPFS filename case problem. */
  +         str_tolower(r->uri);
  +#endif
  +     }
  +#endif  /* __EMX__ || WIN32 */
       }
       else {
        r->args = NULL;
  
  
  

Reply via email to