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

Collapse All | Expand All

(-)ssh.c.orig (-5 / +28 lines)
Lines 186-191 main(int ac, char **av) Link Here
186
	extern int optind, optreset;
186
	extern int optind, optreset;
187
	extern char *optarg;
187
	extern char *optarg;
188
	Forward fwd;
188
	Forward fwd;
189
	char *config_host;
189
190
190
	__progname = ssh_get_progname(av[0]);
191
	__progname = ssh_get_progname(av[0]);
191
	init_rng();
192
	init_rng();
Lines 564-583 again: Link Here
564
	    SYSLOG_FACILITY_USER, 1);
565
	    SYSLOG_FACILITY_USER, 1);
565
566
566
	/*
567
	/*
568
	 * If forwarding is being done, host will be specified as localhost
569
	 * and we won't be able to obtain any host-specific configuration
570
	 * information from the configuration file. To overcome that
571
	 * difficulty, use the HostKeyAlias value specified on the command
572
	 * line for the host name. The name substitution should be applicable
573
	 * in other cases as well so we don't check for localhost.
574
	 */
575
	if (options.host_key_alias == NULL) {
576
		config_host = host;
577
	} else {
578
		config_host = options.host_key_alias;
579
	}
580
	/*
567
	 * Read per-user configuration file.  Ignore the system wide config
581
	 * Read per-user configuration file.  Ignore the system wide config
568
	 * file if the user specifies a config file on the command line.
582
	 * file if the user specifies a config file on the command line.
569
	 */
583
	 */
570
	if (config != NULL) {
584
	if (config != NULL) {
571
		if (!read_config_file(config, host, &options, 0))
585
		if (!read_config_file(config, config_host, &options, 0))
572
			fatal("Can't open user config file %.100s: "
586
			fatal("Can't open user config file %.100s: "
573
			    "%.100s", config, strerror(errno));
587
			    "%.100s", config, strerror(errno));
574
	} else  {
588
	} else  {
575
		snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir,
589
		snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir,
576
		    _PATH_SSH_USER_CONFFILE);
590
		    _PATH_SSH_USER_CONFFILE);
577
		(void)read_config_file(buf, host, &options, 1);
591
		(void)read_config_file(buf, config_host, &options, 1);
578
592
579
		/* Read systemwide configuration file after use config. */
593
		/* Read systemwide configuration file after use config. */
580
		(void)read_config_file(_PATH_HOST_CONFIG_FILE, host,
594
		(void)read_config_file(_PATH_HOST_CONFIG_FILE, config_host,
581
		    &options, 0);
595
		    &options, 0);
582
	}
596
	}
583
597
Lines 700-707 again: Link Here
700
714
701
	signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE early */
715
	signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE early */
702
716
703
	/* Log into the remote system.  This never returns if the login fails. */
717
	/*
704
	ssh_login(&sensitive_data, host, (struct sockaddr *)&hostaddr, pw);
718
	 * Log into the remote system.  This never returns if the login fails.
719
	 * If a hostkeyalias is used, we use that as the host to log into.
720
	 */
721
	if (options.host_key_alias == NULL) {
722
		ssh_login(&sensitive_data, host, (struct sockaddr *)&hostaddr,
723
		    pw);
724
	} else {
725
		ssh_login(&sensitive_data, options.host_key_alias,
726
		    (struct sockaddr *)&hostaddr, pw);
727
	}
705
728
706
	/* We no longer need the private host keys.  Clear them now. */
729
	/* We no longer need the private host keys.  Clear them now. */
707
	if (sensitive_data.nkeys != 0) {
730
	if (sensitive_data.nkeys != 0) {

Return to bug 1039