Thomas Quinot <quinot_at_adacore.com> writes:
> [[[
> Fix failure to find repo in virtual host mode if user name present
>
> * subversion/svnserve/serve.c
> (find_repos): In vhost mode, skip past user name and password,
> if present.
> ]]]
>
> Index: subversion/svnserve/serve.c
> ===================================================================
> --- subversion/svnserve/serve.c (revision 1824204)
> +++ subversion/svnserve/serve.c (working copy)
> @@ -3806,12 +3806,21 @@ find_repos(const char *url,
> return svn_error_createf(SVN_ERR_BAD_URL, NULL,
> "Non-svn URL passed to svn server: '%s'", url);
>
> - if (! vhost)
> + /* In virtual host mode, skip past any USER[:PASSWORD]@ part,
> + else skip past [USER[:PASSWORD]@]HOST/. */
> + if (vhost)
> {
> + const char *h_path = strchr(path, '@');
> + if (h_path != NULL)
> + path = h_path + 1;
> + }
> + else
> + {
> path = strchr(path, '/');
> if (path == NULL)
> path = "";
> }
That looks correct so far, but it leads me to consider port numbers.
svn ls svn://hostname:3691/repo
Should the server look for the repository under 'hostname:3691' or under
the plain 'hostname'? I suspect the port number should be ignored and
that the plain 'hostname' is correct and that makes the current
behaviour another bug. We might be better off using apr_uri_parse()
rather than writing our own parsing code here.
--
Philip
Received on 2018-02-15 16:11:09 CET