[Bug 1159] %u and %h not handled in IdentityFile

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Sun Feb 26 12:49:07 EST 2006


http://bugzilla.mindrot.org/show_bug.cgi?id=1159


djm at mindrot.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1077|                            |ok-
               Flag|                            |




------- Comment #3 from djm at mindrot.org  2006-02-26 12:49 -------
(From update of attachment 1077)
>diff -ru ssh/ssh-keygen.c sshJ/ssh-keygen.c
>--- ssh/ssh-keygen.c	2005-11-28 19:04:55.000000000 -0700
>+++ sshJ/ssh-keygen.c	2006-02-21 15:52:36.000000000 -0700
...
>+ 	/* Read systemwide configuration file after user config. */
>+ 	(void)read_config_file(_PATH_HOST_CONFIG_FILE, hostname, &options, 0);

I don't think we want the other tools to depend on ssh_config. 

>--- ssh/ssh.c	2005-12-19 21:41:07.000000000 -0700
>+++ sshJ/ssh.c	2006-02-21 15:52:36.000000000 -0700
...
> 	for (; i < options.num_identity_files; i++) {
> 		filename = tilde_expand_filename(options.identity_files[i],
> 		    original_real_uid);
>+		filename = percent_expand(filename, "h", pw->pw_dir,	
>+					  "u", pw->pw_name, (char *)NULL);
> 		public = key_load_public(filename, NULL);

This leaks memory. Also, I think it would be better to have:

%u -> user
%h -> local hostname
%d -> home directory

I'll attach a revised patch




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list