6 ms·
It's interesting to me that the fix was pattern matching the ssh hostname and banning a starting hyphen, rather than (say) passing "--" to ssh to signal the end
by jjnoakes 9y ago
It's interesting to me that the fix was pattern matching the ssh hostname and banning a starting hyphen, rather than (say) passing "--" to ssh to signal the end of the intentional options so a hostname of "-oProxyCommand=whatever" is interpreted by ssh properly (as a hostname which can't be reached, instead of as a rogue argument).
I thought this was a fairly well known way to pass arbitrary strings to commands and ensure they aren't interpreted as options (for commands which honor "--", like ssh does).
- peff 9y agoWe discussed that, but it wasn't clear that doing so was portable. It works for OpenSSH. It doesn't for PuTTY. We don't know what other implementations people might have as `ssh` on their systems.
- deleted 9y ago[deleted]
- peterwwillis 9y agoIt seems a little risky to assume separate clients/platforms will always interpret command line arguments the same way. At some point when a client breaks compatibility you have to implement methods to support the one-offs, or drop support. So for portability's sake, why not start writing those methods now, and have a generic universal method to fall back on for untested clients/versions? Or is that really unnecessary?
- avar 9y agoHow would a program like git figure out what flavor of "ssh" program is on the system? Keep in mind that it may change while a long-running git command is running.
- deleted 9y ago[deleted]
- pwdisswordfish 9y agoDropbear[0] doesn't seem to support "--" either. [0] https://matt.ucc.asn.au/dropbear/dropbear.html https://matt.ucc.asn.au/dropbear/dropbear.html
- luckydude 9y agoWhat happens if you do the -- fix and then use PuTTY? If it just fails then I'd argue that's OK, PuTTY will get updated as a result of the failure, no?
- pwdisswordfish 9y agoWhy do you think Lennart Poettering is hated so much?
- gazarsgo 9y ago+100000 Someone needs to teach the next generation about ABI compatibility...
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- pwdisswordfish 9y agoOrdinarily I'd agree, but a starting hyphen isn't valid in a domain name anyway, so it's harmless. RFC 1035: "The labels [a grammar production rule for domain names] must follow the rules for ARPANET host names. They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen. There are also some restrictions on the length. Labels must be 63 characters or less." (And by the way, neither is a leading dot, which I use to my advantage to define hostname aliases in ~/.ssh/config which I can be sure will never clash with anything.)
- LukeShu 9y ago> They must start with a letter By the RFCs, that's true; but if you think it's true in practice, then 4chan.org would like a word with you.
- pwdisswordfish 9y agoRight... but the no-starting-hyphen rule seems to be more universally accepted. ... ...Oh, fuck me. I just found https://archive.fo/T0WcV https://archive.fo/T0WcV ... (archive.is link because Firefox won't open it directly)
- geofft 9y agoI think it's not so much Firefox as your OS - if you're on a GNU platform, glibc will refuse to resolve a hostname that starts with a hyphen (it won't even attempt the resolution), but macOS's libc resolver is totally fine with it. I forget what Windows does.
- danarmak 9y agoChrome and Firefox on Windows 10 both open http://-emmawatson.tumblr.com/ http://-emmawatson.tumblr.com/ without trouble.
- Godel_unicode 9y ago