[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: Daniel Rall <dlr_at_collab.net>
Date: 2005-03-24 23:39:32 CET

On Thu, 2005-03-24 at 16:04 -0600, Ben Collins-Sussman wrote:
...
>So up till now, I've always thought of the 'If: (token)' header as a
>sort of pre-emptive response to an expected authn challenge. "Here's
>my token, you'll probably need it when you see that the resource is
>locked."
>
>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?
>
>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?
>
>Can this problem be fixed by having libsvn_ra_dav send requests
>differently?

The last paragraph of this snippet of the "If Header" section of the DAV
RFC <http://www.ietf.org/rfc/rfc2518.txt> looks particularly relevant:

--- snip ---
9.4 If Header

   If = "If" ":" ( 1*No-tag-list | 1*Tagged-list)
   No-tag-list = List
   Tagged-list = Resource 1*List
   Resource = Coded-URL
   List = "(" 1*(["Not"](State-token | "[" entity-tag "]")) ")"
   State-token = Coded-URL
   Coded-URL = "<" absoluteURI ">"

   The If header is intended to have similar functionality to the If-
   Match header defined in section 14.25 of [RFC2068]. However the If
   header is intended for use with any URI which represents state
   information, referred to as a state token, about a resource as well
   as ETags. A typical example of a state token is a lock token, and
   lock tokens are the only state tokens defined in this specification.

   All DAV compliant resources MUST honor the If header.

   The If header's purpose is to describe a series of state lists. If
   the state of the resource to which the header is applied does not
   match any of the specified state lists then the request MUST fail
   with a 412 (Precondition Failed). If one of the described state
   lists matches the state of the resource then the request may succeed.
--- snip ---

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?

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?

---------------------------------------------------------------------
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:40:43 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.