[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: can't delete a locked file over ra_dav

From: Greg Stein <gstein_at_lyra.org>
Date: 2005-03-24 23:39:00 CET

On Thu, Mar 24, 2005 at 02:39:32PM -0800, Daniel Rall wrote:
> On Thu, 2005-03-24 at 16:04 -0600, Ben Collins-Sussman wrote:
...
> >But it seems like that's not the case at all: mod_dav treats the If:
> >header as something that *must* be matched. In other words, if I
> >invent a phony token and attach it to a PUT request, the request will
> >fail if the resource is unlocked! Is that correct?

Correct. The If: header is a set of assertions. All assertions must
succeed.

> >In any case, assuming this is true... why on earth is mod_dav trying to
> >validate both the resource *and* its parent using the same If: header?

Two resources are involved with a DELETE. The resource itself and its
parent resource. You specified a lock in the If: header that did not have
a URL associated with it. Thus, you were asserting that the lock applied
to all resources involved. But the parent didn't have one, so the request
didn't match the preconditions. Boom.

> >Can this problem be fixed by having libsvn_ra_dav send requests
> >differently?

This *precise* problem was discussed about 4.5 years ago :-) Here is the
link:
  http://mailman.lyra.org/pipermail/dav-dev/2000-September/001533.html

>...
> Does this mean that applying "If" header which contains lock tokens to a
> resource should fail if that resource is not locked? Or does it mean that
> the server should realize that the resource is not locked, and as such, that
> the "If" header does not apply?

Yes. No. The "assertions" thing, noted above.

> The DELETE method does apply to the parent directory of the resource
> being removed. However, if the resource's parent directory is not locked,
> why apply the "If" header _if_ the spec mandates that doing so causes a
> precondition failure?

The two resources are involved: one cause you're deleting it, and one
cause you're adjust the set of member resources. Any assertions made in
the If: header need to reflect that situation.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Mar 24 23:49:34 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.