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

Re: [PATCH] Bug in svn_repos_find_root_path on Windows?

From: Daniel Rall <dlr_at_collab.net>
Date: 2006-11-28 23:44:38 CET

On Tue, 28 Nov 2006, Vlad Georgescu wrote:

> On 11/28/06, Daniel Rall <dlr@collab.net> wrote:
> >On Sun, 26 Nov 2006, Vlad Georgescu wrote:
> >...
> >> It seems that, on Windows, svn_repos_find_root_path will get stuck in
> >> an infinite loop if it is given an absolute path that doesn't actually
> >> contain a repository root. I discovered this after mistyping the root
> >> path when invoking svnserve. The relevant code is this:
> >>
> >> while (1)
> >> {
> >> /* Try to decode the path, so we don't fail if it contains
> >characters
> >> that aren't supported by the OS filesystem. The subversion fs
> >> isn't restricted by the OS filesystem character set. */
> >> err = svn_utf_cstring_from_utf8(&decoded, candidate, pool);
> >> if (!err && check_repos_path(candidate, pool))
> >> break;
> >> svn_error_clear(err);
> >> if (candidate[0] == '\0' || strcmp(candidate, "/") == 0)
> >> return NULL;
> >> candidate = svn_path_dirname(candidate, pool);
> >> }
> >>
> >> Notice that it only gets out of the loop when it encounters the Unix
> >> root directory. The following patch fixes this problem:
> >>
> >> [[[
> >> * subversion/libsvn_repos/repos.c
> >> (svn_repos_find_root_path): Check that we reached the filesystem
> >> root in a cross-platform
> >> manner.
> >> ]]]
> >
> >Thanks Vlad, committed in r22483.
>
> On a related note, shouldn't svnserve check the validity of the --root
> argument? That's how I ran into this problem in the first place.

Sounds good to me. If no one thinks different, do you mind putting
together a patch?

- Dan

  • application/pgp-signature attachment: stored
Received on Tue Nov 28 23:46:05 2006

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