Bugzilla – Attachment 911 Details for
Bug 1039
Incomplete application of HostKeyAlias in ssh
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to use HostKeyAlias for the hostname
ssh.c.diff (text/plain), 2.32 KB, created by
cdmclain
on 2005-05-13 03:28:45 AEST
(
hide
)
Description:
patch to use HostKeyAlias for the hostname
Filename:
MIME Type:
Creator:
cdmclain
Created:
2005-05-13 03:28:45 AEST
Size:
2.32 KB
patch
obsolete
>--- ssh.c.orig Thu May 12 12:20:27 2005 >+++ ssh.c Thu May 12 12:55:15 2005 >@@ -186,6 +186,7 @@ main(int ac, char **av) > extern int optind, optreset; > extern char *optarg; > Forward fwd; >+ char *config_host; > > __progname = ssh_get_progname(av[0]); > init_rng(); >@@ -564,20 +565,33 @@ again: > SYSLOG_FACILITY_USER, 1); > > /* >+ * If forwarding is being done, host will be specified as localhost >+ * and we won't be able to obtain any host-specific configuration >+ * information from the configuration file. To overcome that >+ * difficulty, use the HostKeyAlias value specified on the command >+ * line for the host name. The name substitution should be applicable >+ * in other cases as well so we don't check for localhost. >+ */ >+ if (options.host_key_alias == NULL) { >+ config_host = host; >+ } else { >+ config_host = options.host_key_alias; >+ } >+ /* > * Read per-user configuration file. Ignore the system wide config > * file if the user specifies a config file on the command line. > */ > if (config != NULL) { >- if (!read_config_file(config, host, &options, 0)) >+ if (!read_config_file(config, config_host, &options, 0)) > fatal("Can't open user config file %.100s: " > "%.100s", config, strerror(errno)); > } else { > snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir, > _PATH_SSH_USER_CONFFILE); >- (void)read_config_file(buf, host, &options, 1); >+ (void)read_config_file(buf, config_host, &options, 1); > > /* Read systemwide configuration file after use config. */ >- (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, >+ (void)read_config_file(_PATH_HOST_CONFIG_FILE, config_host, > &options, 0); > } > >@@ -700,8 +714,17 @@ again: > > signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE early */ > >- /* Log into the remote system. This never returns if the login fails. */ >- ssh_login(&sensitive_data, host, (struct sockaddr *)&hostaddr, pw); >+ /* >+ * Log into the remote system. This never returns if the login fails. >+ * If a hostkeyalias is used, we use that as the host to log into. >+ */ >+ if (options.host_key_alias == NULL) { >+ ssh_login(&sensitive_data, host, (struct sockaddr *)&hostaddr, >+ pw); >+ } else { >+ ssh_login(&sensitive_data, options.host_key_alias, >+ (struct sockaddr *)&hostaddr, pw); >+ } > > /* We no longer need the private host keys. Clear them now. */ > if (sensitive_data.nkeys != 0) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1039
:
911
|
915