You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Michael Smith <ms...@xn.com.au> on 2001/03/28 03:54:29 UTC
webdav, propfind and lockdiscovery problem
Hi,
I'm running into a problem with lockdiscovery - specifically, the
'owner' element returned is.. strange. The relevent code is this:
generatedXML.writeElement(null, "owner", XMLPrinter.OPENING);
generatedXML.writeElement(null, "href", XMLPrinter.OPENING);
generatedXML.writeText
(URLEncode(req.getServletPath() + token.getSubjectUri()));
generatedXML.writeElement(null, "href", XMLPrinter.CLOSING);
generatedXML.writeElement(null, "owner", XMLPrinter.CLOSING);
There's actually two problems here. One is that the req.getServletPath()
is being URL-encoded, when it shouldn't be (otherwise it gets encoded
twice, I think - the end result is wrong, anyway). That's easily fixed.
However, it raises the following question (my second problem): _why_ is
the servlet path being prepended to the subject URI in the first place?
The correct solution would seem (to me) to be to just have this:
generatedXML.writeElement(null, "owner", XMLPrinter.OPENING);
generatedXML.writeText(token.getSubjectURI());
generatedXML.writeElement(null, "owner", XMLPrinter.CLOSING);
I'd change this myself, but I presume there's some reason for things
being like this to begin with. Remy - why is it doing this?
A note: the webdav RFC gives the <owner> element as having 'ANY'
content. There are examples which have an <href> within it, but there's
nothing to imply that that's needed. There doesn't seem to be a good
reason to have it in this specific case.
Michael
Re: webdav, propfind and lockdiscovery problem
Posted by Michael Smith <ms...@xn.com.au>.
> One thing to double check -- did you re-check-out slide under your new
> user ID? You won't be able to commit based on the anonymous CVS login.
>
Yes. I made that mistake years ago - and learnt from it :)
Since CVS (well, ssh) is asking me for a passphrase, I'm confident that
this isn't the problem. Of course, it could be something related...
Ahah!
I didn't actually read the "how to use ssh" stuff on the jakarta website
in sufficient detail. I just told it to use the same cvsroot as for
anoncvs, but with my username, and using ssh. Since that worked, I
assumed it was correct and didn't look further. A closer reading of the
website shows that it isn't - oops.
Sorry for bothering people.
Michael
Re: webdav, propfind and lockdiscovery problem
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Tue, 27 Mar 2001, Remy Maucherat wrote:
> > > +1 (unless the spec states that a uri should be put here).
> > > Note that the uri should be either encoded or put in a CDATA section.
> > > So I would do :
> > > generatedXML.writeElement(null, "owner", XMLPrinter.OPENING);
> > > generatedXML.writeData(token.getSubjectURI());
> > > generatedXML.writeElement(null, "owner", XMLPrinter.CLOSING);
> > >
> > > Go ahead and commit that fix :)
> >
> > Well, I made the change (along with a hefty comment explaining WHY we
> > don't just write it out as text). However, when I try to commit (this is
> > the first time I've actually committed something to slide myself, of
> > course), I get this:
> >
> >
> > **** Access denied: Insufficient Karma
> > (msmith|jakarta-slide/src/webdav/server/org/apache/slide/webdav/method)
> > cvs server: Pre-commit check failed
> > cvs [server aborted]: correct above errors first!
> >
> > This is, to say the least, an obscure error message. I have absolutely
> > no clue what it means, in other words. Remy?
>
> Nobody added you in the allow list for the repository, apparently.
>
> Craig ? ;) ;) ;)
>
> Remy
>
>
One thing to double check -- did you re-check-out slide under your new
user ID? You won't be able to commit based on the anonymous CVS login.
Craig
Re: webdav, propfind and lockdiscovery problem
Posted by Remy Maucherat <re...@apache.org>.
> > +1 (unless the spec states that a uri should be put here).
> > Note that the uri should be either encoded or put in a CDATA section.
> > So I would do :
> > generatedXML.writeElement(null, "owner", XMLPrinter.OPENING);
> > generatedXML.writeData(token.getSubjectURI());
> > generatedXML.writeElement(null, "owner", XMLPrinter.CLOSING);
> >
> > Go ahead and commit that fix :)
>
> Well, I made the change (along with a hefty comment explaining WHY we
> don't just write it out as text). However, when I try to commit (this is
> the first time I've actually committed something to slide myself, of
> course), I get this:
>
>
> **** Access denied: Insufficient Karma
> (msmith|jakarta-slide/src/webdav/server/org/apache/slide/webdav/method)
> cvs server: Pre-commit check failed
> cvs [server aborted]: correct above errors first!
>
> This is, to say the least, an obscure error message. I have absolutely
> no clue what it means, in other words. Remy?
Nobody added you in the allow list for the repository, apparently.
Craig ? ;) ;) ;)
Remy
Re: webdav, propfind and lockdiscovery problem
Posted by Michael Smith <ms...@xn.com.au>.
> +1 (unless the spec states that a uri should be put here).
> Note that the uri should be either encoded or put in a CDATA section.
> So I would do :
> generatedXML.writeElement(null, "owner", XMLPrinter.OPENING);
> generatedXML.writeData(token.getSubjectURI());
> generatedXML.writeElement(null, "owner", XMLPrinter.CLOSING);
>
> Go ahead and commit that fix :)
Well, I made the change (along with a hefty comment explaining WHY we
don't just write it out as text). However, when I try to commit (this is
the first time I've actually committed something to slide myself, of
course), I get this:
**** Access denied: Insufficient Karma
(msmith|jakarta-slide/src/webdav/server/org/apache/slide/webdav/method)
cvs server: Pre-commit check failed
cvs [server aborted]: correct above errors first!
This is, to say the least, an obscure error message. I have absolutely
no clue what it means, in other words. Remy?
Michael
Re: webdav, propfind and lockdiscovery problem
Posted by Remy Maucherat <re...@apache.org>.
> Hi,
>
> I'm running into a problem with lockdiscovery - specifically, the
> 'owner' element returned is.. strange. The relevent code is this:
>
> generatedXML.writeElement(null, "owner", XMLPrinter.OPENING);
> generatedXML.writeElement(null, "href", XMLPrinter.OPENING);
> generatedXML.writeText
> (URLEncode(req.getServletPath() + token.getSubjectUri()));
> generatedXML.writeElement(null, "href", XMLPrinter.CLOSING);
> generatedXML.writeElement(null, "owner", XMLPrinter.CLOSING);
>
> There's actually two problems here. One is that the req.getServletPath()
> is being URL-encoded, when it shouldn't be (otherwise it gets encoded
> twice, I think - the end result is wrong, anyway). That's easily fixed.
> However, it raises the following question (my second problem): _why_ is
> the servlet path being prepended to the subject URI in the first place?
>
> The correct solution would seem (to me) to be to just have this:
>
> generatedXML.writeElement(null, "owner", XMLPrinter.OPENING);
> generatedXML.writeText(token.getSubjectURI());
> generatedXML.writeElement(null, "owner", XMLPrinter.CLOSING);
>
> I'd change this myself, but I presume there's some reason for things
> being like this to begin with. Remy - why is it doing this?
>
> A note: the webdav RFC gives the <owner> element as having 'ANY'
> content. There are examples which have an <href> within it, but there's
> nothing to imply that that's needed. There doesn't seem to be a good
> reason to have it in this specific case.
+1 (unless the spec states that a uri should be put here).
Note that the uri should be either encoded or put in a CDATA section.
So I would do :
generatedXML.writeElement(null, "owner", XMLPrinter.OPENING);
generatedXML.writeData(token.getSubjectURI());
generatedXML.writeElement(null, "owner", XMLPrinter.CLOSING);
Go ahead and commit that fix :)
Remy