Change port separator to semicolon : since it's more standard
Kindly suggesting to switch to semicolon character : as port separator as [user@]hostname[:port]. Current port separator is ^ which is less standard -- semicolon is used both in ssh and scp programs.
For maintaining backward compatibility, similar to the support of legacy /, the character ^ can still be supported.
Appendix
A bit of history:
-
From what I've been able to understand from Git history, everything started in 2008 with the usage of
/as port separator, implemented in 1. -
Five years later, in 2013, This was changed 2 to
#to fix a problem related toscp. Not sure, but a plausible reason for this could be a clash with the usage of/for directories. Note that the usage of/was still allowed as legacy. -
That same year it was changed again 3 to
%for some reason I have not been able to understand. -
Then, in 2014, since
%is used by IPv6 addresses, this was changed 4 to use^as port separator -- and this is the current state.
As a comment, / is still supported as legacy.
My bad, just noticed that : is called colon (not semicolon). Will fix in rev. 2 if approach is validated :)
The syntax here is only for multihop, which OpenSSH added later with their -J option, the syntax being a little bit different.
I think the reason I avoided : was because it is used for ipv6 separators. I guess that should be OK if it can handle the standard [] quoting, maybe by using split_address_port() https://github.com/mkj/dropbear/blob/7f80432ea6aa7bb25ce8043169be15052ac22f78/src/common-runopts.c#L128
I can't remember exactly but assume the reason # was removed was because it was hard to type without it being treated as a shell comment. / being treated as a directory separator sounds likely.
I believe the : was avoided because of the scp use for specifying the destination filename/path like scp -P port user@host:filename if you do multihops with different ports you will get : scp user@host1:2022,user@host2:3022:filename instead of scp user@host1^2022,user@host2^3022:filename But I might be wrong
I believe the : was avoided because of the scp use for specifying the destination filename/path like scp -P port user@host:filename
Ah yes, I think that's right. So even with [] for ipv6, a colon might be problematic.