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

Re: svn commit: r27170 - trunk/subversion/libsvn_wc

From: Ben Collins-Sussman <sussman_at_red-bean.com>
Date: 2007-10-13 17:11:26 CEST

On 10/13/07, C. Michael Pilato <cmpilato@collab.net> wrote:

> svn_ra_get_file(session, "/foo") is *not* a legal invocation. The paths
> provided to the RA API are, as the various docstring state, relative to the
> session URL. And that's how all four RA layers treat them. But some of the
> those layers can pass the "relative" path through to the FS directly, while
> others need to construct URLs out of them. And svn_path_join(session-url,
> "/foo") == "/foo", not "session-url/foo".
>
> Your use of the API was broken here, nothing more.

Well sure, there's much more here. I was invoking the API
incorrectly, and ra_local and ra_dav were *still working correctly*.
That's a bug to fix. :-)

I was thinking something like:

Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c (revision 27173)
+++ subversion/libsvn_ra/ra_loader.c (working copy)
@@ -621,6 +621,11 @@
                              apr_hash_t **props,
                              apr_pool_t *pool)
 {
+ if (*path == "/")
+ return svn_error_create
+ (SVN_ERR_RA_ILLEGAL_URL, NULL,
+ _("svn_ra_get_file was passed an absolute path."));
+
   return session->vtable->get_file(session, path, revision, stream,
                                    fetched_rev, props, pool);
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 13 17:11:37 2007

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.