|
Lines 871-882
main(int ac, char **av)
Link Here
|
| 871 |
addrs = resolve_canonicalize(&host, options.port); |
871 |
addrs = resolve_canonicalize(&host, options.port); |
| 872 |
|
872 |
|
| 873 |
/* |
873 |
/* |
| 874 |
* If canonicalization not requested, or if it failed then try to |
874 |
* If CanonicalizePermittedCNAMEs have been specified but |
| 875 |
* resolve the bare hostname name using the system resolver's usual |
875 |
* other canonicalization did not happen (by not being requested |
| 876 |
* search rules. Skip the lookup if a ProxyCommand is being used |
876 |
* or by failing with fallback) then the hostname may still be changed |
| 877 |
* unless the user has specifically requested canonicalisation. |
877 |
* as a result of CNAME following. |
|
|
878 |
* |
| 879 |
* Try to resolve the bare hostname name using the system resolver's |
| 880 |
* usual search rules and then apply the CNAME follow rules. |
| 881 |
* |
| 882 |
* Skip the lookup if a ProxyCommand is being used unless the user |
| 883 |
* has specifically requested canonicalisation for this case via |
| 884 |
* CanonicalizeHostname=always |
| 878 |
*/ |
885 |
*/ |
| 879 |
if (addrs == NULL && (option_clear_or_none(options.proxy_command) || |
886 |
if (addrs == NULL && options.num_permitted_cnames != 0 && |
|
|
887 |
(option_clear_or_none(options.proxy_command) || |
| 880 |
options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) { |
888 |
options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) { |
| 881 |
if ((addrs = resolve_host(host, options.port, 1, |
889 |
if ((addrs = resolve_host(host, options.port, 1, |
| 882 |
cname, sizeof(cname))) == NULL) |
890 |
cname, sizeof(cname))) == NULL) |
|
Lines 967-972
main(int ac, char **av)
Link Here
|
| 967 |
fatal("No ControlPath specified for \"-O\" command"); |
975 |
fatal("No ControlPath specified for \"-O\" command"); |
| 968 |
if (options.control_path != NULL) |
976 |
if (options.control_path != NULL) |
| 969 |
muxclient(options.control_path); |
977 |
muxclient(options.control_path); |
|
|
978 |
|
| 979 |
/* |
| 980 |
* If hostname canonicalisation was not enabled, then we may not |
| 981 |
* have yet resolved the hostname. Do so now. |
| 982 |
*/ |
| 983 |
if (addrs == NULL && options.proxy_command == NULL) { |
| 984 |
if ((addrs = resolve_host(host, options.port, 1, |
| 985 |
cname, sizeof(cname))) == NULL) |
| 986 |
cleanup_exit(255); /* resolve_host logs the error */ |
| 987 |
} |
| 970 |
|
988 |
|
| 971 |
timeout_ms = options.connection_timeout * 1000; |
989 |
timeout_ms = options.connection_timeout * 1000; |
| 972 |
|
990 |
|