You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Roy Fielding <fi...@hyperreal.com> on 1997/03/18 10:46:30 UTC

cvs commit: apache/src util_script.h util_script.c mod_negotiation.c

fielding    97/03/18 01:46:29

  Modified:    src       util_script.h util_script.c mod_negotiation.c
  Log:
  Fixed infinite loop when a trailing slash is included after a type map
  file URL (extra path info).
  
  Submitted by: Petr Lampa and Roy Fielding
  Reviewed by: Dean Gaudet
  
  Revision  Changes    Path
  1.14      +1 -0      apache/src/util_script.h
  
  Index: util_script.h
  ===================================================================
  RCS file: /export/home/cvs/apache/src/util_script.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -C3 -r1.13 -r1.14
  *** util_script.h	1997/01/01 18:10:47	1.13
  --- util_script.h	1997/03/18 09:46:27	1.14
  ***************
  *** 61,66 ****
  --- 61,67 ----
    char **create_argv_cmd(pool *p, char *av0, const char *args, char *path);
    #endif
    char **create_environment(pool *p, table *t);
  + int find_path_info(char *uri, char *path_info);
    void add_cgi_vars(request_rec *r);
    void add_common_vars(request_rec *r);
    #define scan_script_header(a1,a2) scan_script_header_err(a1,a2,NULL)
  
  
  
  1.47      +1 -1      apache/src/util_script.c
  
  Index: util_script.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/util_script.c,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -C3 -r1.46 -r1.47
  *** util_script.c	1997/03/03 05:01:44	1.46
  --- util_script.c	1997/03/18 09:46:27	1.47
  ***************
  *** 213,219 ****
     * and find as much of the two that match as possible.
     */
    
  ! static int find_path_info (char *uri, char *path_info)
    {
        int lu = strlen(uri);
        int lp = strlen(path_info);
  --- 213,219 ----
     * and find as much of the two that match as possible.
     */
    
  ! int find_path_info (char *uri, char *path_info)
    {
        int lu = strlen(uri);
        int lp = strlen(path_info);
  
  
  
  1.36      +6 -1      apache/src/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -C3 -r1.35 -r1.36
  *** mod_negotiation.c	1997/03/14 03:27:32	1.35
  --- mod_negotiation.c	1997/03/18 09:46:28	1.36
  ***************
  *** 62,67 ****
  --- 62,68 ----
    #include "http_request.h"
    #include "http_core.h"
    #include "http_log.h"
  + #include "util_script.h"
    
    /* define TCN_02 to allow for Holtman I-D transparent negotiation.
     * This file currently implements the draft-02, except for
  ***************
  *** 1875,1883 ****
        if (na_result == na_not_applied)
            set_neg_headers(r, neg, na_not_applied);
    
        udir = make_dirstr (r->pool, r->uri, count_dirs (r->uri));
        udir = escape_uri(r->pool, udir);
  !     internal_redirect (make_full_path (r->pool, udir, best->file_name), r);
        return OK;
    }
    
  --- 1876,1888 ----
        if (na_result == na_not_applied)
            set_neg_headers(r, neg, na_not_applied);
    
  +     if (r->path_info && *r->path_info) {
  +         r->uri[find_path_info(r->uri, r->path_info)] = '\0';
  +     }
        udir = make_dirstr (r->pool, r->uri, count_dirs (r->uri));
        udir = escape_uri(r->pool, udir);
  !     internal_redirect(pstrcat(r->pool, udir, best->file_name, r->path_info,
  !                               NULL), r);
        return OK;
    }