From a9008cf3d1b7d8f4cd6ff96f348caeaed7571776 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 20 May 2003 23:09:00 +0000 Subject: [PATCH] mod_dav providers define a 'can_be_activity' callback. Unfortunately, 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 Reviewed by: Sander Striker git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99966 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/dav/main/mod_dav.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGES b/CHANGES index 14cac07abf..3310402b22 100644 --- 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 ] + *) configure.in: Play nice with libtool-1.5. [Wilfredo Sanchez] *) Prevent the server from crashing when entering infinite loops. The diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index a68557369e..8be2c68ba9 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -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, + ""); + return dav_handle_err(r, err, NULL); + } + /* ### what about locking? */ /* attempt to create the activity */ -- 2.50.1