httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@decus.org (Rodent of Unusual Size)
Subject [PATCH] to fix mod_userdir's broken handling of ///~user
Date Thu, 03 Jul 1997 11:27:01 GMT
    As pointed out by Nick Allen <nallen@acm.org> in PR#805, mod_userdir
    makes the assumption that r->uri *has* to start with "/~" or else it
    won't work. "///~user" will not.  This patch addresses that by
    collapsing duplicated slashes before making the test.

    It's unclear whether "/~user" and "///~user" should be considered
    equivalent.  Any thoughts?  Roy?  I can't seem to find anything onw
    way or the other..

    #ken    :-)}

Index: mod_userdir.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_userdir.c,v
retrieving revision 1.17
diff -c -r1.17 mod_userdir.c
*** mod_userdir.c	1997/06/30 20:38:53	1.17
--- mod_userdir.c	1997/07/03 11:22:27
***************
*** 190,204 ****
      void *server_conf = r->server->module_config;
      const userdir_config *s_cfg =
              (userdir_config *) get_module_config (server_conf, &userdir_module);
!     char *name = r->uri;
      const char *userdirs = pstrdup (r->pool, s_cfg->userdir);
      const char *w, *dname, *redirect;
      char *x = NULL;
  
      /*
       * If the URI doesn't match our basic pattern, we've nothing to do with
!      * it.
       */
      if (
          (s_cfg->userdir == NULL) ||
          (name[0] != '/') ||
--- 190,205 ----
      void *server_conf = r->server->module_config;
      const userdir_config *s_cfg =
              (userdir_config *) get_module_config (server_conf, &userdir_module);
!     char *name = pstrdup (r->pool, r->uri);
      const char *userdirs = pstrdup (r->pool, s_cfg->userdir);
      const char *w, *dname, *redirect;
      char *x = NULL;
  
      /*
       * If the URI doesn't match our basic pattern, we've nothing to do with
!      * it.  Edit out any repeated slashes from our copy of the URI first.
       */
+     no2slash (name);
      if (
          (s_cfg->userdir == NULL) ||
          (name[0] != '/') ||
***************
*** 207,213 ****
          return DECLINED;
      }
  
!     dname = name + 2;
      w = getword(r->pool, &dname, '/');
  
      /*
--- 208,215 ----
          return DECLINED;
      }
  
!     name = strchr (r->uri, '~');
!     dname = --name + 2;
      w = getword(r->pool, &dname, '/');
  
      /*

Mime
View raw message