View | Details | Raw Unified | Return to bug 3343 | Differences between
and this patch

Collapse All | Expand All

(-)a/readconf.c (+2 lines)
Lines 2291-2296 void Link Here
2291
initialize_options(Options * options)
2291
initialize_options(Options * options)
2292
{
2292
{
2293
	memset(options, 'X', sizeof(*options));
2293
	memset(options, 'X', sizeof(*options));
2294
	options->host_arg = NULL;
2294
	options->forward_agent = -1;
2295
	options->forward_agent = -1;
2295
	options->forward_agent_sock_path = NULL;
2296
	options->forward_agent_sock_path = NULL;
2296
	options->forward_x11 = -1;
2297
	options->forward_x11 = -1;
Lines 3225-3230 dump_client_config(Options *o, const char *host) Link Here
3225
	free(all_key);
3226
	free(all_key);
3226
3227
3227
	/* Most interesting options first: user, host, port */
3228
	/* Most interesting options first: user, host, port */
3229
	dump_cfg_string(oHost, o->host_arg);
3228
	dump_cfg_string(oUser, o->user);
3230
	dump_cfg_string(oUser, o->user);
3229
	dump_cfg_string(oHostname, host);
3231
	dump_cfg_string(oHostname, host);
3230
	dump_cfg_int(oPort, o->port);
3232
	dump_cfg_int(oPort, o->port);
(-)a/readconf.h (+1 lines)
Lines 28-33 struct allowed_cname { Link Here
28
};
28
};
29
29
30
typedef struct {
30
typedef struct {
31
	char   *host_arg;	/* Host arg as specified on command line. */
31
	int     forward_agent;	/* Forward authentication agent. */
32
	int     forward_agent;	/* Forward authentication agent. */
32
	char   *forward_agent_sock_path; /* Optional path of the agent. */
33
	char   *forward_agent_sock_path; /* Optional path of the agent. */
33
	int     forward_x11;	/* Forward X11 display. */
34
	int     forward_x11;	/* Forward X11 display. */
(-)a/ssh.c (-8 / +8 lines)
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

Return to bug 3343