]> granicus.if.org Git - apache/commitdiff
mod_dav: mod_dav overrides dav_fs response on PUT failure. PR 35981.
authorGraham Leggett <minfrin@apache.org>
Tue, 30 Apr 2013 15:28:57 +0000 (15:28 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 30 Apr 2013 15:28:57 +0000 (15:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1477687 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/dav/main/mod_dav.c

diff --git a/CHANGES b/CHANGES
index 5d0b53c88f460ea4e6fc26002b74b6ce06946534..3a09209b881e5682d88680dfd2a4e837bbca0a82 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_dav: mod_dav overrides dav_fs response on PUT failure. PR 35981
+     [Basant Kumar Kukreja <basant.kukreja sun.com>, Alejandro Alvarez
+     <alejandro.alvarez.ayllon cern.ch>]
+
   *) mod_dav: Do not segfault on PROPFIND with a zero length DBM.
      PR 52559 [Diego Santa Cruz <diego.santaCruz spinetix.com>]
 
index 90a6c5a88a85f5e98bf22407f664273fc1586b68..6094049858ef790457c6c11492082629b1594ef2 100644 (file)
@@ -960,12 +960,17 @@ static int dav_method_put(request_rec *r)
     /* Create the new file in the repository */
     if ((err = (*resource->hooks->open_stream)(resource, mode,
                                                &stream)) != NULL) {
-        /* ### assuming FORBIDDEN is probably not quite right... */
-        err = dav_push_error(r->pool, HTTP_FORBIDDEN, 0,
-                             apr_psprintf(r->pool,
-                                          "Unable to PUT new contents for %s.",
-                                          ap_escape_html(r->pool, r->uri)),
-                             err);
+        int status = err->status ? err->status : HTTP_FORBIDDEN;
+        if (status > 299) {
+            err = dav_push_error(r->pool, status, 0,
+                                 apr_psprintf(r->pool,
+                                              "Unable to PUT new contents for %s.",
+                                              ap_escape_html(r->pool, r->uri)),
+                                 err);
+        }
+        else {
+            err = NULL;
+        }
     }
 
     if (err == NULL && has_range) {