| Summary: | Use getservbyname(3) for port numbers | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Christian Weisgerber <naddy> | ||||
| Component: | Miscellaneous | Assignee: | Assigned to nobody <unassigned-bugs> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | enhancement | ||||||
| Priority: | P5 | ||||||
| Version: | 7.7p1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
Committed. closing resolved bugs as of 8.6p1 release |
Created attachment 3186 [details] Patch for resolving port specifications with getservbyname Is there a reason ssh doesn't consult services(5) for port numbers? This has irked me forever. I'd rather write ssh -L icb:localhost:icb instead of ssh -L 7326, wait, 7236, uhm, grep icb /etc/services... I don't think there is any syntactic ambiguity since Unix sockets already must contain a '/'. The patch below adds this: * Try to resolve a port specification with getservbyname(3) if a numeric conversion fails. * Make the "Port" option in ssh_config handle its argument as a port rather than a plain integer. All other command line switches and configuration file options already use a2port(). This passes the existing regression tests.