Re: [PATCH/RFC] connect.c: Ignore extra colon after hostname

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 7, 2015 at 3:50 AM, Torsten Bögershausen <tboegi@xxxxxx> wrote:
> Ignore an extra ':' at the end of the hostname in URL's like
> "ssh://example.com:/path/to/repo"
>
> The colon is ment to separate a port number from the hostname.

s/ment/meant/

More below.

> If the port is empty, the colon should be ignored, see RFC 3986.
>
> It had been working for URLs with ssh:// scheme, but was unintentionally
> broken in 86ceb3, "allow ssh://user@[2001:db8::1]/repo.git"
>
> Reported-by: Reid Woodbury Jr. <reidw@xxxxxxxxxxxx>
> Signed-off-by: Torsten Bögershausen <tboegi@xxxxxx>
> ---
> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
> index 02b40b1..1f67bdd 100755
> --- a/t/t5601-clone.sh
> +++ b/t/t5601-clone.sh
> @@ -387,14 +387,18 @@ do
>  done
>
>  #with ssh:// scheme
> -test_expect_success 'clone ssh://host.xz/home/user/repo' '
> -       test_clone_url "ssh://host.xz/home/user/repo" host.xz "/home/user/repo"
> -'
> -
> -# from home directory
> -test_expect_success 'clone ssh://host.xz/~repo' '
> -       test_clone_url "ssh://host.xz/~repo" host.xz "~repo"
> +#ignore trailing colon
> +for tcol in "" :
> +do
> +       test_expect_success "clone ssh://host.xz$tcol/home/user/repo" '
> +               test_clone_url "ssh://host.xz$tcol/home/user/repo" host.xz /home/user/repo
> +       '
> +       # from home directory
> +       test_expect_success "clone ssh://host.xz$tcol/~repo" '
> +       test_clone_url "ssh://host.xz$tcol/~repo" host.xz "~repo"
>  '
> +done
> +test_done

Unwanted test_done crept in?

>  # with port number
>  test_expect_success 'clone ssh://host.xz:22/home/user/repo' '
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]