Subject: Re: REBIND a parent to a child

From: Geoffrey M Clemm <[email-masked]>
Date: Tue, 24 Oct 2006 07:53:15 -0400

My response was incomplete.  In case the server does support binding 
loops, but /a was the only binding to the collection, so the REBIND 
effectively deletes the collection, then the server would fail the request 
with DAV:new-binding in the DAV:error status response message (since the 
collection does not contain the new binding, since it has been deleted).

Cheers,
Geoff

----------------

The server can disallow this, in case it doesn't support binding loops, in 
which case it would return DAV:cycle-allowed to indicate which 
pre-condition failed in its DAV:error status response message (see 
<http://tools.ietf.org/html/draft-ietf-webdav-rfc2518bis-15#section-16> 
for a description of DAV:error status response>).

Cheers,
Geoff

[email-masked] wrote on 10/24/2006 06:44:41 AM:

> Hi
> What is the expected behaviour if I try to rebind a collection to 
> one of its descendants. For example, suppose I try to rebind /a to 
> /a/b. Should the server allow the method and remove the collection 
> 'a'? Or should it return an error? If so, what error? 
> Thanks
> Sriram

---

From: Julian Reschke <[email-masked]>
Date: Tue, 24 Oct 2006 18:28:19 +0200

Geoffrey M Clemm schrieb:
> effectively deletes the collection, then the server would fail the 
> request with DAV:new-binding in the DAV:error status response message 
> (since the collection does not contain the new binding, since it has 
> been deleted).
> 
> Cheers,
> Geoff

Well. But if there's another binding to b, such as /c, all is fine, 
right? "/a" would be gone, but would be accessible as "/c/a".

Best regards, Julian

---

From: Geoffrey M Clemm <[email-masked]>
Date: Tue, 24 Oct 2006 12:40:32 -0400

I don't think so.  Suppose that /a/b identified a resource R1.  Also 
suppose that /c identified resource R1. 

If you rebind /a to /a/b, that will delete the binding named "b" to R1 in 
the collection named by "/a", so /c will still identify R1, not the folder 
that was identified by "/a", so there is no reason for /c/a to identify 
the collection (unless /c/a originally identified the collection, in which 
case it falls under the criteria of my message below, i.e. that there was 
another binding to /a).

Cheers,
Geoff

---

From: Julian Reschke <[email-masked]>
Date: Tue, 24 Oct 2006 19:12:37 +0200

Geoffrey M Clemm schrieb:
> If you rebind /a to /a/b, that will delete the binding named "b" to R1 
> in the collection named by "/a", so /c will still identify R1, not the 
> folder that was identified by "/a", so there is no reason for /c/a to 
> identify the collection (unless /c/a originally identified the 
> collection, in which case it falls under the criteria of my message 
> below, i.e. that there was another binding to /a).
> 
> Cheers,
> Geoff

Ah. Seems I misread the question then.

---

From: "Chetan Reddy" <[email-masked]>
Date: Wed, 25 Oct 2006 10:40:08 -0400

I wrote my question in a 'Reply' instead of 'Reply to all'. Forwarding
Julian's reply to the list.

---------- Forwarded message ----------
From: Julian Reschke <[email-masked]>
Date: Oct 25, 2006 6:08 AM
Subject: Re: REBIND a parent to a child
To: Chetan Reddy <[email-masked]>
Cc: Geoffrey M Clemm <[email-masked]>

Chetan Reddy schrieb:
> The last three mails have confused me a bit.
> A request to rebind /a to /a/b:
> Request-URI    /a (identifies a collection resource R1)
> segment          b
> href                 /a
>
> case 1: /c is also bound to R1
> case 2: /a is the only binding to R1
>
> I think case 1 should succeed(with /c and /c/b both pointing to R1 and
> /a not existing anymore) and case 2 should fail.

I would agree that if the request succeeds in case 1, that's what the
outcome should be.

I'm not sure whether case 2 needs to fail, but that's certainly what I
would do.

> In general, if the collection identified by the Request-URI is not
> reachable from root after removing the  old binding(href), the server
> should fail the request.
> Is that correct?

I'm not sure it needs to, but it's certainly a plausible approach.

Best regards, Julian

(any reason why you took this off-list?)

---

From: "Chetan Reddy" <[email-masked]>
Date: Thu, 26 Oct 2006 18:11:36 -0400

> To: Chetan Reddy <[email-masked] >

If the collection identified by Request-URI is not reachable from root after
the old binding is removed (the old binding MUST be removed for the
DAV:binding-deleted postcondition to hold) then the DAV:new-binding
postcondition will not hold as the new binding will not be reachable from
root. Hence, i think the server MUST fail the request.

Chetan

---

From: Julian Reschke <[email-masked]>
Date: Fri, 27 Oct 2006 09:35:40 +0200

Chetan Reddy schrieb:
> If the collection identified by Request-URI is not reachable from root 
> after the old binding is removed (the old binding MUST be removed for 
> the DAV:binding-deleted postcondition to hold) then the DAV:new-binding 
> postcondition will not hold as the new binding will not be reachable 
> from root. Hence, i think the server MUST fail the request.

The postcondition is (from 
<http://greenbytes.de/tech/webdav/draft-ietf-webdav-bind-latest.html#rfc.section.6>):

"(DAV:new-binding): The collection MUST have a binding that maps the 
segment specified in the DAV:segment element in the request body, to the 
resource that was identified by the DAV:href element in the request body."

It doesn't say anything about reachability.

So is this just an academic question, or do you expect any interop 
problems here? This is just an edge case, I'd say...

Best regards, Julian