From d8c4d74dd9d6d9f33343fb291401ea665752dfcf Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Sat, 12 Jan 2008 19:32:24 +0000 Subject: [PATCH] mod_proxy_ftp: Fix base for directory listings. PR 27834 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@611466 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++--- modules/proxy/mod_proxy_ftp.c | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 90ccf0071d..9fd0565925 100644 --- a/CHANGES +++ b/CHANGES @@ -2,15 +2,15 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) mod_proxy_ftp: Fix base for directory listings. + PR 27834 [Nick Kew] + *) mod_proxy_http: Return HTTP status codes instead of apr_status_t values for errors encountered while forwarding the request body PR 44165 [Eric Covener] *) mod_logio: Provide optional function to allow modules to adjust the bytes_in count [Eric Covener] - - *) mod_rewrite: Don't canonicalise URLs with [P,NE] - PR 43319 [] *) mod_ssl: Added server name indication support (RFC 4366). PR 34607. [Kaspar Brand ] diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c index 01aa9c52aa..90906bc456 100644 --- a/modules/proxy/mod_proxy_ftp.c +++ b/modules/proxy/mod_proxy_ftp.c @@ -314,6 +314,7 @@ static apr_status_t proxy_send_dir_filter(ap_filter_t *f, /* basedir is either "", or "/%2f" for the "squid %2f hack" */ const char *basedir = ""; /* By default, path is relative to the $HOME dir */ char *wildcard = NULL; + const char *escpath; /* Save "scheme://site" prefix without password */ site = apr_uri_unparse(p, &f->r->parsed_uri, APR_URI_UNP_OMITPASSWORD | APR_URI_UNP_OMITPATHINFO); @@ -350,13 +351,14 @@ static apr_status_t proxy_send_dir_filter(ap_filter_t *f, str = (basedir[0] != '\0') ? "%2f/" : ""; /* print "ftp://host/" */ + escpath = ap_escape_html(p, path); str = apr_psprintf(p, DOCTYPE_HTML_3_2 "\n \n %s%s%s\n" + "\n" " \n" " \n

Directory of " "%s/%s", - site, basedir, ap_escape_html(p, path), - site, str); + site, basedir, escpath, site, basedir, escpath, site, str); APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str), p, c->bucket_alloc)); -- 2.50.1