Re: git: Wrong parsing of ssh urls with IPv6 literals ignores port

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: git: Wrong parsing of ssh urls with IPv6 literals ignores port

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:03

René Scharfe [off-list ref] writes:
Am 12.06.2012 23:00, schrieb Jonathan Nieder:
quoted
Jonathan Nieder wrote:
quoted
René Scharfe wrote:
quoted
quoted
How about this instead?
Looks good to me.
Oh, hold on a second.  Won't this get confused by

	ssh://[::1]/foo/bar/baz:80/qux

?
It shouldn't, because the host part is NUL-terminated before
get_port() is called.  Let's see (with the patch):

	$ git clone ssh://[::1]/foo/bar/baz:80/qux
	Cloning into 'qux'...
	ssh: connect to host ::1 port 22: Connection refused
	fatal: The remote end hung up unexpectedly

René
Yeah, I was wondering how that would get confused myself.  Jonathan,
ack again?

Re: git: Wrong parsing of ssh urls with IPv6 literals ignores port

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:54:04

On Wed, Jun 13, 2012 at 10:21:04AM -0700, Junio C Hamano wrote:
René Scharfe [off-list ref] writes:
quoted
Am 12.06.2012 23:00, schrieb Jonathan Nieder:
quoted
quoted
Oh, hold on a second.  Won't this get confused by

	ssh://[::1]/foo/bar/baz:80/qux
[...]
quoted
It shouldn't, because the host part is NUL-terminated before
get_port() is called.  Let's see (with the patch):
[...]
Yeah, I was wondering how that would get confused myself.  Jonathan,
ack again?
Yeah.  I had missed that when proto == PROTO_SSH that means the proto
!= PROTO_LOCAL branch has been taken and the port is NUL-terminated.

So

Reviewed-by: Jonathan Nieder <redacted>

It seems like a good fix given the current code structure.  Sorry for
the false alarm.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help