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

Re: svnadmin dump/verify/load uses svn_path_join

From: D.J. Heap <djheap_at_gmail.com>
Date: 2007-03-13 18:08:20 CET

On 3/13/07, Lieven Govaerts <svnlgo@mobsol.be> wrote:
[snip]
>
> Hm, are you talking about paths relative to the repository root? Or actual urls?

Absolute url's (I guess they are called paths as well) within the
repository. During a 'svnadmin verify', for example, in
libsvn_fs_fs\tree.c the open_path function calls svn_path_join on line
679:

path_so_far = svn_path_join(path_so_far, entry, pool);

and appears to be expecting an absolute url to be returned. In the
case of the sample repo, the return value is 'c:hi' rather than
'/c:hi' as it expects -- this later causes the assert on line 148 of
make_txn_root to fail and kills the process.

>
> > Should 'svnadmin dump/verify/load' not be using svn_path_join or
> > should svn_path_join work with urls?
>
> I checked out the comments of svn_path_join, and they say:
>
> * Note that the contents of @a base are not examined, so it is possible to
> * use this function for constructing URLs, or for relative URLs or
> * repository paths.
> *
> * This function is NOT appropriate for native (local) file
> * paths. Only for "internal" canonicalized paths, since it uses '/'
> * for the separator. Further, an absolute path (for @a component) is
> * based on a leading '/' character. Thus, an "absolute URI" for the
> * @a component won't be detected.
>
> The problem is that svn_path_join *is* used for local paths despite the warning
> in the comments, so that's why it has to work with Windows paths too. We miss a
> clear separation between functions for internal paths and functions for native
> paths at the moment.

Right -- this sort of thing has happened a few times in the past, I
believe. Since urls and paths are very similar on unixy OS', it's
easy to miss the distinction.

Do we need a svn_path_local_join (or something) and then fix callers
that use svn_path_join incorrectly? That can be hard to determine
sometimes, if I remember correctly.

>
> Based on your report I'm worried a bit that there are more situations like this,
> were path functions for internal paths were modified to work for Windows paths.
> I'll see what I can find, tonight.

Thanks for looking at it!

DJ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 13 18:08:46 2007

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