From 4144b652c80a29a76e8428a3a69811dcc0e4241c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 26 Feb 2008 19:49:03 +0000 Subject: [PATCH] Merge r611466 from trunk: mod_proxy_ftp: Fix base for directory listings. PR 27834 Submitted by: niq Reviewed by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@631360 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 5 ----- modules/proxy/mod_proxy_ftp.c | 6 ++++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 8b49522deee..bfa2a9c6f93 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.9 + *) mod_proxy_ftp: Fix base for directory listings. + PR 27834 [Nick Kew] + *) mod_logio: Provide optional function to allow modules to adjust the bytes_in count [Eric Covener] diff --git a/STATUS b/STATUS index cedf0533a2e..2880e6baae0 100644 --- a/STATUS +++ b/STATUS @@ -81,11 +81,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_proxy_ftp: fixup base URL for directory listings. - PR 27834 - http://svn.apache.org/viewvc?rev=611466&view=rev - +1: niq, rpluem, jim - * Worker and Event MPMs: Fix race condition in pool recycling PR 44402 http://svn.apache.org/viewvc?rev=630335&view=rev diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c index 3cacac6e65c..7aa8ac09c2b 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.47.2