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

RE: svn commit: r916286 - in /subversion/trunk/subversion/mod_dav_svn: dav_svn.h mirror.c mod_dav_svn.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Fri, 26 Feb 2010 17:17:47 +0100

> -----Original Message-----
> From: Kamesh Jayachandran [mailto:kamesh_at_collab.net]
> Sent: vrijdag 26 februari 2010 16:29
> To: commits_at_subversion.apache.org
> Subject: Re: svn commit: r916286 - in
> /subversion/trunk/subversion/mod_dav_svn: dav_svn.h mirror.c
> mod_dav_svn.c
>
> On 02/25/2010 11:36 PM, Julian Foad wrote:
> > On Thu, 2010-02-25 at 20:45 +0530, Kamesh Jayachandran wrote:
> >
> >> On 02/25/2010 08:29 PM, Julian Foad wrote:
> >>
> >>> kameshj_at_apache.org wrote:
> >>>
> > [...]
> >
> >>>> - if (strcmp(uri.path, root_dir) == 0) {
> >>>> + if (uri.path)
> >>>> + canonicalized_uri = svn_dirent_canonicalize(uri.path, r->pool);
> >>>>
> >>>>
> >>> Oops, you called "dirent_canonicalize" on a URI.
> >>>
> >> Is there any uri canonicalize function?.
> >>
> > svn_uri_canonicalize() if it's a URI (in which non-URI characters must
> > be escaped as '%XX').
> >
> >
>
> Ok, I wanted to see the failure in my eyes before attempting to fix the
> same.
>
> Following are my observations,
>
> <Location "/svn 1/">
> DAV svn
> SVNParentPath /repositories
> </Location>
> <Location "/svn 2/">
> DAV svn
> SVNParentPath /repositories-slave
> SVNMasterURI "http://localhost/svn 1"
> </Location>
>
> I could not see the difference between "svn_uri_canonicalize()" and
> svn_dirent_canonicalize() for the above configuration, by the way both
> fails while proxying.
>
> I have an upcoming local patch in progress attempting to fix the same.

Is it a local disk path?

If no, then never use svn_dirent_*() on it.
(If yes, always use svn_dirent_*() on it)

svn_dirent_*() has platform dependent behavior.
You might not see it on your OS, but the canonicalization rules for dirents are defined by your platform.

Just a few simple examples:
The canonical format of 'a:/':
* On linux: 'a:' (never end a path with a '/', except for the root directory)
* On Windows: 'A:/' (Drive letters always uppercase and in this case followed by a '/', as 'A:' refers to the current directory on drive A:)

'C:hi' is a dirent to the file named 'C:hi' on Linux, but on Windows it is a dirent pointing to the file 'hi' in the current directory of drive C:.

If you use svn_uri_*(), these paths are handled the same, which is most likely what you want. The <Location> tag defines the path space on your webserver.

        Bert
Received on 2010-02-26 17:18:25 CET

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.