On a system with an older release in /usr/bin and current OpenSSH in /usr/local/bin, but for $reasons keeping /usr/bin first in the $PATH, having "ssh" exec itself using "ssh" as argv[0] will execute the wrong SSH. That's what ProxyJump does. Encountered via: git using core.sshCommand as a setting, and a config file using ProxyJump. The child ssh will complain about the invalid configuration directive. Since config can be read by "sftp" etc, I suspect that one fix is to look for a path separator in "our" argv[0] and if found, then replace the last component with "ssh" and use the result as the new process' argv[0], otherwise fall back to "ssh".
Created attachment 3157 [details] Prefer to use argv[0] for ProxyJump ssh binary
By inspection, that will break sftp because argv[0] will refer to sftp and the ProxyJump will then try to execute sftp for the proxy connection. (Thanks for looking at this!)
I don't follow - sftp exec()s ssh with argv[0] as /usr/sbin/ssh not sftp.
Sorry. I was going from recollection that there was a scenario where something parsed an ssh_config(5) file with argv[0] not ending "/ssh". Looking again now, I only see ssh-keysign(1) doing so, and ProxyJump clearly doesn't apply to that. My mistake. Shutting up now.
Fix applied - this will be in OpenSSH 7.8
Close RESOLVED bugs with the release of openssh-8.0