Bug 3485 - Allow percent expansion in Forward host (and port?) in addition to path
Summary: Allow percent expansion in Forward host (and port?) in addition to path
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 9.1p1
Hardware: amd64 Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-19 09:01 AEDT by Mattthijs Tadema
Modified: 2022-10-19 09:01 AEDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mattthijs Tadema 2022-10-19 09:01:11 AEDT
I was trying to use percent expansion in a LocalForward directive to dynamically change the listening hostname based on the hostname that I was connecting to, and realized that this was not possible. In the man pages for ssh_config it does mention that the expansion only works for Unix domain socket paths, though near the end in the TOKENS section it briefly mentions percent expansion works for LocalForward in general, hence my confusion.
I went looking through the code and noticed that it seems like the choice was made deliberately to only expand paths and not the hosts and ports too.
I realize that my usecase might be too specific, and I could not find anybody else complaining about this particular "problem" so perhaps I'm the only one, but I think it would be nice to have this feature.
If there is a good reason for not percent expanding forward hosts (and ports) please let me know.

Best regards,
Matthijs