Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 11735 invoked by uid 500); 20 May 2003 19:07:02 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Delivered-To: moderator for dev@httpd.apache.org Received: (qmail 61856 invoked from network); 20 May 2003 14:27:00 -0000 X-Authentication-Warning: kepler.ch.collab.net: sussman set sender to sussman@collab.net using -f Sender: sussman@collab.net To: dev@httpd.apache.org Subject: [PATCH] mod_dav activity creation Reply-To: sussman@red-bean.com From: Ben Collins-Sussman Date: 20 May 2003 09:26:32 -0500 Message-ID: <867k8lr8x3.fsf@kepler.ch.collab.net> Lines: 38 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Greg Stein asked me to submit a patch for a shortcoming in mod_dav. Hopefully this can make it into httpd-2.0.46. Here it is: ------------------------------------------ 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. Index: mod_dav.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/modules/dav/main/mod_dav.c,v retrieving revision 1.92 diff -u -r1.92 mod_dav.c --- mod_dav.c 3 Feb 2003 17:52:58 -0000 1.92 +++ mod_dav.c 20 May 2003 14:20:26 -0000 @@ -4068,6 +4068,15 @@ 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 */