rse         98/02/23 07:18:52

  Modified:    src/modules/standard mod_rewrite.c
  Log:
  mod_rewrite shouldn't make any assumptions on which characters a username can
  contain because a lot of Unix derivates allow more then [a-zA-Z0-9]. We now
  treat anything between ^/~ and  the next slash or end of URL as the username
  because this does not hurt us. We always expand only after we have
  successfully resolved the cut out name via /etc/passwd.
  
  Revision  Changes    Path
  1.68      +4 -10     apache-1.3/src/modules/standard/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- mod_rewrite.c     1998/02/23 08:27:38     1.67
  +++ mod_rewrite.c     1998/02/23 15:18:50     1.68
  @@ -2244,7 +2244,7 @@
   
   /*
   **
  -**  Expand tilde-paths (~user) through
  +**  Expand tilde-paths (/~user) through
   **  Unix /etc/passwd database information
   **
   */
  @@ -2259,15 +2259,9 @@
       newuri = uri;
       if (uri != NULL && strlen(uri) > 2 && uri[0] == '/' && uri[1] == '~') {
           /* cut out the username */
  -        for (j = 0, i = 2; j < sizeof(user)-1 && uri[i] != '\0' && 
  -#ifndef CHARSET_EBCDIC
  -                       (   (uri[i] >= '0' && uri[i] <= '9')
  -                        || (uri[i] >= 'a' && uri[i] <= 'z')
  -                        || (uri[i] >= 'A' && uri[i] <= 'Z'))
  -#else
  -                       isalnum(uri[i])
  -#endif
  -                        ; )
  +        for (j = 0, i = 2; j < sizeof(user)-1
  +                           && uri[i] != '\0'
  +                           && uri[i] != '/'  ; )
               user[j++] = uri[i++];
           user[j] = '\0';
   
  
  
  

Reply via email to