From: Justin Erenkrantz Date: Sat, 27 Dec 2003 06:03:44 +0000 (+0000) Subject: * modules/dav/main/mod_dav.c (dav_method_copymove): For a 401 on the X-Git-Tag: 2.0.49~277 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bb1c19f4e379e2a6eec7975c1dcf39e88c94707;p=thirdparty%2Fapache%2Fhttpd.git * modules/dav/main/mod_dav.c (dav_method_copymove): For a 401 on the destination resource, propagate the WWW-Auth header from the subrequest back to the client. Backport of modules/dav/main/mod_dav.c r1.101 from httpd-2.1 PR: 15571 Reviewed by: jorton, trawick, jerenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@102113 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index d61afdfb9ec..9e1928f7042 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.49 + *) mod_dav: Return a WWW-auth header for MOVE/COPY requests where + the destination resource gives a 401. PR 15571. [Joe Orton] + *) SECURITY [CAN-2003-0020]: Escape arbitrary data before writing into the errorlog. [André Malo] diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 57f222f2588..e1e87dbee7d 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -2618,6 +2618,15 @@ static int dav_method_copymove(request_rec *r, int is_move) return dav_error_response(r, lookup.err.status, lookup.err.desc); } if (lookup.rnew->status != HTTP_OK) { + const char *auth = apr_table_get(lookup.rnew->err_headers_out, + "WWW-Authenticate"); + if (lookup.rnew->status == HTTP_UNAUTHORIZED && auth != NULL) { + /* propagate the WWW-Authorization header up from the + * subreq so the client sees it. */ + apr_table_set(r->err_headers_out, "WWW-Authenticate", + apr_pstrdup(r->pool, auth)); + } + /* ### how best to report this... */ return dav_error_response(r, lookup.rnew->status, "Destination URI had an error.");