You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Uwe Zeisberger <ze...@informatik.uni-freiburg.de> on 2004/11/05 14:18:02 UTC

[BUG] svn ls file:///

Hello,

(I use svn 1.1.0rc2 while writing this mail, but observed similar
behaviour with HEAD a few days ago.)

if I issue the command

	svn log file:///

(in a wc or not) I get:

Assertion failed: is_canonical (path, len), file [..]/subversion/libsvn_subr/path.c, line 376
Abort

I think file:/// is a valid url standing for '/'. (Please correct me, if
I'm wrong.)

If file:/// is a valid (and canonical) path, is_canonical
(defined in path.c, line 95+) returns a wrong result (namely false).

If not, svn should not abort with a failed assertion.

Regards,
Uwe

-- 
Uwe Zeisberger

$ dc -e "5735816763073014741799356604682P"

Re: [PATCH] Re: [BUG] svn ls file:///

Posted by Uwe Zeisberger <ze...@informatik.uni-freiburg.de>.
Erik Huelsmann wrote:
> > > Also, svn_path_canonicalize is buggy in that it strips the
> > > trailing slash in this case.
> > From RFC 1738 Section 3.1:
> >   ... common syntax for the scheme-specific data:
> > 
> >     //<user>:<password>@<host>:<port>/<url-path>
> > 
> >   [...] "/<url-path>" may be excluded.
> > 
> > So "file://" and "file:///" are the same. Stripping a slash from
> > "file://" (as svn_path_canonicalize does) is however an error.
> 
> Umm, yes, but just above that it says:
>    "URL schemes that involve the direct use of an IP-based protocol"
> 
> I don't think file:// is in that category.
For the sake of simplicity I'd suggest that anyhow it follows the common
syntax.  Else you may have to distinct the scheme for canonicalization
as http URLS may have a total of two slashes and file URLS have at least
three.

Regards
Uwe

-- 
Uwe Zeisberger

http://www.google.com/search?q=30+hours+and+4+days+in+seconds

Re: [PATCH] Re: [BUG] svn ls file:///

Posted by Erik Huelsmann <eh...@gmail.com>.
> > Also, svn_path_canonicalize is buggy in that it strips the trailing slash
> > in this case.
> From RFC 1738 Section 3.1:
>   ... common syntax for the scheme-specific data:
> 
>     //<user>:<password>@<host>:<port>/<url-path>
> 
>   [...] "/<url-path>" may be excluded.
> 
> So "file://" and "file:///" are the same. Stripping a slash from
> "file://" (as svn_path_canonicalize does) is however an error.

Umm, yes, but just above that it says:
   "URL schemes that involve the direct use of an IP-based protocol"

I don't think file:// is in that category.


bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] Re: [BUG] svn ls file:///

Posted by Uwe Zeisberger <ze...@informatik.uni-freiburg.de>.
Hello,

Peter N. Lundblad wrote:
> On Fri, 5 Nov 2004, Uwe Zeisberger wrote:
> > if I issue the command
> >
> > 	svn log file:///
> >
> > (in a wc or not) I get:
> >
> > Assertion failed: is_canonical (path, len), file [..]/subversion/libsvn_subr/path.c, line 376
> > Abort
> >
> > I think file:/// is a valid url standing for '/'. (Please correct me, if
> > I'm wrong.)
> >
> > If file:/// is a valid (and canonical) path, is_canonical
> > (defined in path.c, line 95+) returns a wrong result (namely false).
> >
> Yes, it should skip the scheme and host parts before treating it like a
> path.
> 
> Also, svn_path_canonicalize is buggy in that it strips the trailing slash
> in this case.
From RFC 1738 Section 3.1:
  ... common syntax for the scheme-specific data:

    //<user>:<password>@<host>:<port>/<url-path>

  [...] "/<url-path>" may be excluded.

So "file://" and "file:///" are the same. Stripping a slash from
"file://" (as svn_path_canonicalize does) is however an error.

I attach a patch, which let subversion accept "file://".

I didn't change the assertions, which assume, that a canonical pathname
does not end with a slash. `svn log file:///' doesn't fail with an
assertion any more and I didn't found an other way to provoke this
failure, yet. I believe, there is still work to be done.

Heres the log:

[[[
Fix a part from issue #2116: 'svn log file:///' results in a failed assertion 

These changes add the correct handling for "file://"

* subversion/libsvn_subr/path.c
  (skip_uri_schema): also find :// at the end of path
  (svn_path_canonicalize): don't strip a leading slash from "file://"

* subversion/libsvn_ra_local/split_url.c
  (svn_ra_local__split_URL): handle "file://" correctly

* subversion/tests/libsvn_subr/path-test.c
  (test_is_url): add "file:///" -> TRUE, "file://" -> TRUE and 
  "file:/" -> FALSE
  (test_canonicalize): add "file:///" -> "file://", "file://" ->
  "file://", "file:///usr/" -> "file:///usr", "file:///usr" -> "file:///usr"
]]]

-- 
Uwe Zeisberger

http://www.google.com/search?q=i+squared

Re: [BUG] svn ls file:///

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Fri, 5 Nov 2004, Uwe Zeisberger wrote:

> (I use svn 1.1.0rc2 while writing this mail, but observed similar
> behaviour with HEAD a few days ago.)
>
> if I issue the command
>
> 	svn log file:///
>
> (in a wc or not) I get:
>
> Assertion failed: is_canonical (path, len), file [..]/subversion/libsvn_subr/path.c, line 376
> Abort
>
> I think file:/// is a valid url standing for '/'. (Please correct me, if
> I'm wrong.)
>
> If file:/// is a valid (and canonical) path, is_canonical
> (defined in path.c, line 95+) returns a wrong result (namely false).
>
Yes, it should skip the scheme and host parts before treating it like a
path.

Also, svn_path_canonicalize is buggy in that it strips the trailing slash
in this case.

Would you like to file an issue for this - or even better prepare a patch.
(It is OK if you don't do, ofcourse.)

Thank you for the bug report,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn ls file:///

Posted by Ben Reser <be...@reser.org>.
On Fri, Nov 05, 2004 at 03:18:02PM +0100, Uwe Zeisberger wrote:
> Hello,
> 
> (I use svn 1.1.0rc2 while writing this mail, but observed similar
> behaviour with HEAD a few days ago.)
> 
> if I issue the command
> 
> 	svn log file:///
> 
> (in a wc or not) I get:
> 
> Assertion failed: is_canonical (path, len), file [..]/subversion/libsvn_subr/path.c, line 376
> Abort
> 
> I think file:/// is a valid url standing for '/'. (Please correct me, if
> I'm wrong.)
> 
> If file:/// is a valid (and canonical) path, is_canonical
> (defined in path.c, line 95+) returns a wrong result (namely false).
> 
> If not, svn should not abort with a failed assertion.

Technically yes, file:/// is valid.  That said why would anyone put a
repo directly in the root file system?

This might be as simple as fixing is_canonical or it might require
further changes to our path functions because we assume that a path
never ends in /.  There are a lot of special casing for just '/' that
might need to be extended to 'file:///'.

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org