]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* modules/dav/main/mod_dav.c (dav_method_copymove): For a 401 on the
authorJustin Erenkrantz <jerenkrantz@apache.org>
Sat, 27 Dec 2003 06:03:44 +0000 (06:03 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Sat, 27 Dec 2003 06:03:44 +0000 (06:03 +0000)
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

CHANGES
modules/dav/main/mod_dav.c

diff --git a/CHANGES b/CHANGES
index d61afdfb9ec47be6ddb4e544183214c1a8b42958..9e1928f704256e4c218195cce96b4c97a87256d0 100644 (file)
--- 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]
 
index 57f222f2588c84ddcf5a7600b06ecea96fb9bf88..e1e87dbee7d83db200802fae331edbc2d453b151 100644 (file)
@@ -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.");