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

Re: svn commit: r10133 - in trunk/subversion: include libsvn_subr tests/clients/cmdline tests/libsvn_subr

From: Josh Pieper <jjp_at_pobox.com>
Date: 2004-07-04 17:21:17 CEST

Greg Hudson wrote:
> On Sun, 2004-07-04 at 09:01, jpieper@tigris.org wrote:
> > Issue #1779: Improve svn_path_canonicalize to make more
> > transformations aimed at removing path specification redundancies.
>
> I am concerned about the case where one runs something like "svn st
> foo/../bar", where foo is a symlink with multiple path elements.
> (Symlinks within working dirs around allowed, but I see no reason why
> symlinks should be disallowed in the portion of a path leading up to the
> working copy.)
>
> You did not break this case; it was already broken due to the call to
> apr_filepath_merge() in libsvn_subr/opt.c:svn_opt_args_to_target_array.
> But it seems like the logic of both apr_filepath_merge() and the new
> logic of svn_path_canonicalize() are fundamentally flawed, unless they
> are only applied within a playground where directory symlinks are
> disallowed.

Yes, I considered that case; this also stopped generating an error
when you try "invalid_path/../real_path." Apache does this when
resolving URLs to filesystem paths, so at least one other application
handles paths the same way. Of course that doesn't mean it is a valid
method, but collapsing the ".." makes the copy code more robust to
differing path specifications in the common cases.

> > (svn_path_canonicalize): Replaced old implementation with new that
> > uses nearly identical logic to large portions of
> > apr_filepath_merge. It condenses redundant "/./", "/../", and
> > "//" portions of the path, as well as removing any trailing
> > separator characters.
>
> When you say in a log message that a function is "nearly identical" to a
> preexisting function, you might say how it's different. As it stands,
> I'm not sure why you didn't use apr_filepath_merge to implement
> svn_path_canonicalize.

Yes, good point. I will document the reasons why in the log message.

-Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jul 4 17:22:04 2004

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.