| Summary: | Add the ability to capture wildcard portion of Host keyword in ssh_config | ||
|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Lavneet <lavneetpuri> |
| Component: | ssh | Assignee: | Assigned to nobody <unassigned-bugs> |
| Status: | NEW --- | ||
| Severity: | enhancement | CC: | dtucker |
| Priority: | P5 | ||
| Version: | -current | ||
| Hardware: | Other | ||
| OS: | Linux | ||
|
Description
Lavneet
2020-03-31 06:10:46 AEDT
There's a couple of problems with this: - the current matching code doesn't lend itself to supporting this kind of backreference - it does however currently support multiple wildcards (eg "*-*-?.domain.*") which don't map well onto the token you suggested. It'd probably need to be regex-style digits %1 - %9. - "Host" specifically supports multiple matches. You could have, eg, "Host pc-? *-* *.*.*", at which point you could have 1, 2 or 3 backrefs. In that case, what does "%3" evaluate to and when? I'm not sure it's useful enough to be worth the extra complexity in the parser, which is already pretty complex. I ended up writting a wrapper script to account for this special case - one that is not very neat - so I realize the complexity this may add to the parser. However, in terms of usefulness, ssh configs are among the best features that boost productivity. I wonder if this logic (and more advanced parsing feature to follow) could be offloaded from the main build - as a plugin of sorts. I'm not aware if this has been done before for any other components of the program. |