]> granicus.if.org Git - apache/commitdiff
mod_dav providers define a 'can_be_activity' callback. Unfortunately,
authorSander Striker <striker@apache.org>
Tue, 20 May 2003 23:09:00 +0000 (23:09 +0000)
committerSander Striker <striker@apache.org>
Tue, 20 May 2003 23:09:00 +0000 (23:09 +0000)
mod_dav isn't calling it before creating an activity.  This is a
required precondition (along with the resource not existing), as
defined in the deltaV RFC (3253), section 13.5.

* mod_dav.c (dav_method_make_activity): if available, call provider's
  'can_be_activity' callback as a precondition to making an activity.

Submitted by: Ben Collins-Sussman <sussman@apache.org>
Reviewed by: Sander Striker

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99966 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/dav/main/mod_dav.c

diff --git a/CHANGES b/CHANGES
index 14cac07abfd9ee1d20f7109bccb2e0c4d6fb00dd..3310402b220fc5c0e6295377ac289eb7b425c8c3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) Fix for mod_dav.  Call the 'can_be_activity' callback, if provided,
+     when a MKACTIVITY request comes in.
+     [Ben Collins-Sussman <sussman@apache.org>]
+
   *) configure.in: Play nice with libtool-1.5. [Wilfredo Sanchez]
 
   *) Prevent the server from crashing when entering infinite loops. The
index a68557369e9a458c7d1dfb660918d915f7ee13c6..8be2c68ba954a4483a5db2ad290e4b6a80c2eb69 100644 (file)
@@ -4068,6 +4068,15 @@ static int dav_method_make_activity(request_rec *r)
         return dav_handle_err(r, err, NULL);
     }
 
+    /* the provider must say whether the resource can be created as
+       an activity, i.e. whether the location is ok.  */
+    if (vsn_hooks->can_be_activity != NULL
+        && !(*vsn_hooks->can_be_activity)(resource)) {
+      err = dav_new_error(r->pool, HTTP_FORBIDDEN, 0,
+                          "<DAV:activity-location-ok/>");
+      return dav_handle_err(r, err, NULL);
+    }
+
     /* ### what about locking? */
 
     /* attempt to create the activity */