|
Lines 619-625
main(int ac, char **av)
Link Here
|
| 619 |
struct ssh *ssh = NULL; |
619 |
struct ssh *ssh = NULL; |
| 620 |
int i, r, opt, exit_status, use_syslog, direct, timeout_ms; |
620 |
int i, r, opt, exit_status, use_syslog, direct, timeout_ms; |
| 621 |
int was_addr, config_test = 0, opt_terminated = 0, want_final_pass = 0; |
621 |
int was_addr, config_test = 0, opt_terminated = 0, want_final_pass = 0; |
| 622 |
char *p, *cp, *line, *argv0, *logfile, *host_arg; |
622 |
char *p, *cp, *line, *argv0, *logfile; |
| 623 |
char cname[NI_MAXHOST], thishost[NI_MAXHOST]; |
623 |
char cname[NI_MAXHOST], thishost[NI_MAXHOST]; |
| 624 |
struct stat st; |
624 |
struct stat st; |
| 625 |
struct passwd *pw; |
625 |
struct passwd *pw; |
|
Lines 1096-1102
main(int ac, char **av)
Link Here
|
| 1096 |
if (!host) |
1096 |
if (!host) |
| 1097 |
usage(); |
1097 |
usage(); |
| 1098 |
|
1098 |
|
| 1099 |
host_arg = xstrdup(host); |
1099 |
options.host_arg = xstrdup(host); |
| 1100 |
|
1100 |
|
| 1101 |
/* Initialize the command to execute on remote host. */ |
1101 |
/* Initialize the command to execute on remote host. */ |
| 1102 |
if ((command = sshbuf_new()) == NULL) |
1102 |
if ((command = sshbuf_new()) == NULL) |
|
Lines 1142-1148
main(int ac, char **av)
Link Here
|
| 1142 |
logit("%s, %s", SSH_RELEASE, SSH_OPENSSL_VERSION); |
1142 |
logit("%s, %s", SSH_RELEASE, SSH_OPENSSL_VERSION); |
| 1143 |
|
1143 |
|
| 1144 |
/* Parse the configuration files */ |
1144 |
/* Parse the configuration files */ |
| 1145 |
process_config_files(host_arg, pw, 0, &want_final_pass); |
1145 |
process_config_files(options.host_arg, pw, 0, &want_final_pass); |
| 1146 |
if (want_final_pass) |
1146 |
if (want_final_pass) |
| 1147 |
debug("configuration requests final Match pass"); |
1147 |
debug("configuration requests final Match pass"); |
| 1148 |
|
1148 |
|
|
Lines 1211-1217
main(int ac, char **av)
Link Here
|
| 1211 |
debug("re-parsing configuration"); |
1211 |
debug("re-parsing configuration"); |
| 1212 |
free(options.hostname); |
1212 |
free(options.hostname); |
| 1213 |
options.hostname = xstrdup(host); |
1213 |
options.hostname = xstrdup(host); |
| 1214 |
process_config_files(host_arg, pw, 1, NULL); |
1214 |
process_config_files(options.host_arg, pw, 1, NULL); |
| 1215 |
/* |
1215 |
/* |
| 1216 |
* Address resolution happens early with canonicalisation |
1216 |
* Address resolution happens early with canonicalisation |
| 1217 |
* enabled and the port number may have changed since, so |
1217 |
* enabled and the port number may have changed since, so |
|
Lines 1363-1372
main(int ac, char **av)
Link Here
|
| 1363 |
xasprintf(&cinfo->uidstr, "%llu", |
1363 |
xasprintf(&cinfo->uidstr, "%llu", |
| 1364 |
(unsigned long long)pw->pw_uid); |
1364 |
(unsigned long long)pw->pw_uid); |
| 1365 |
cinfo->keyalias = xstrdup(options.host_key_alias ? |
1365 |
cinfo->keyalias = xstrdup(options.host_key_alias ? |
| 1366 |
options.host_key_alias : host_arg); |
1366 |
options.host_key_alias : options.host_arg); |
| 1367 |
cinfo->conn_hash_hex = ssh_connection_hash(cinfo->thishost, host, |
1367 |
cinfo->conn_hash_hex = ssh_connection_hash(cinfo->thishost, host, |
| 1368 |
cinfo->portstr, options.user); |
1368 |
cinfo->portstr, options.user); |
| 1369 |
cinfo->host_arg = xstrdup(host_arg); |
1369 |
cinfo->host_arg = xstrdup(options.host_arg); |
| 1370 |
cinfo->remhost = xstrdup(host); |
1370 |
cinfo->remhost = xstrdup(host); |
| 1371 |
cinfo->remuser = xstrdup(options.user); |
1371 |
cinfo->remuser = xstrdup(options.user); |
| 1372 |
cinfo->homedir = xstrdup(pw->pw_dir); |
1372 |
cinfo->homedir = xstrdup(pw->pw_dir); |
|
Lines 1543-1550
main(int ac, char **av)
Link Here
|
| 1543 |
timeout_ms = options.connection_timeout * 1000; |
1543 |
timeout_ms = options.connection_timeout * 1000; |
| 1544 |
|
1544 |
|
| 1545 |
/* Open a connection to the remote host. */ |
1545 |
/* Open a connection to the remote host. */ |
| 1546 |
if (ssh_connect(ssh, host, host_arg, addrs, &hostaddr, options.port, |
1546 |
if (ssh_connect(ssh, host, options.host_arg, addrs, &hostaddr, |
| 1547 |
options.connection_attempts, |
1547 |
options.port, options.connection_attempts, |
| 1548 |
&timeout_ms, options.tcp_keep_alive) != 0) |
1548 |
&timeout_ms, options.tcp_keep_alive) != 0) |
| 1549 |
exit(255); |
1549 |
exit(255); |
| 1550 |
|
1550 |
|