Re: ssh config Host case insensitive

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On Tue, Feb 04, 2014 at 08:07:20AM +1100, Damien Miller wrote:
> On Mon, 3 Feb 2014, Ike Devolder wrote:
> 
> > Hi,
> > 
> > There seems to be an issue where a case sensitive Host entry is no
> > longer working after update to openssh 6.5
> > 
> > example entry: (was working before update)
> > Host MyHost
> > 	Hostname 192.168.0.1
> > 	Port 1234
> > 	User root
> > 	IdentityFile ~/.ssh/id_rsa
> > 
> > When issuing "ssh MyHost" the outcome is now:
> > ssh: Could not resolve hostname myhost: Name or service not known
> > 
> > When the above entry is changed to:
> > Host myhost, the connection works fine again.
> 
> This should fix it:
> 
> Index: ssh.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/ssh/ssh.c,v
> retrieving revision 1.398
> diff -u -p -r1.398 ssh.c
> --- ssh.c	31 Jan 2014 16:39:19 -0000	1.398
> +++ ssh.c	3 Feb 2014 21:05:40 -0000
> @@ -752,7 +752,6 @@ main(int ac, char **av)
>  	if (!host)
>  		usage();
>  
> -	lowercase(host);
>  	host_arg = xstrdup(host);
>  
>  	OpenSSL_add_all_algorithms();
> @@ -882,6 +881,7 @@ main(int ac, char **av)
>  	}
>  
>  	/* If canonicalization requested then try to apply it */
> +	lowercase(host);
>  	if (options.canonicalize_hostname != SSH_CANONICALISE_NO)
>  		addrs = resolve_canonicalize(&host, options.port);
>  	/*

So it was kinda intentional ?

on my 6.5p1 the patch fails
patch -Np0 -i ../../fix-mixed-upper-lower-case-host.patch 
patching file ssh.c
Hunk #1 FAILED at 752.
Hunk #2 FAILED at 882.
2 out of 2 hunks FAILED -- saving rejects to file ssh.c.rej

probably due to the 'older' version of ssh.c following applies on 6.5p1

--- ssh.c.orig	2014-02-04 08:40:18.866715480 +0100
+++ ssh.c	2014-02-04 08:43:22.931826364 +0100
@@ -780,7 +780,6 @@
 	if (!host)
 		usage();
 
-	lowercase(host);
 	host_arg = xstrdup(host);
 
 	OpenSSL_add_all_algorithms();
@@ -914,6 +913,7 @@
 	}
 
 	/* If canonicalization requested then try to apply it */
+	lowercase(host);
 	if (options.canonicalize_hostname != SSH_CANONICALISE_NO)
 		addrs = resolve_canonicalize(&host, options.port);
 	/*

I have checked and the configuration as given in my example works again.

Thank you very much for such quick answer :)

-- 
Ike

Attachment: pgpScTAmPFjub.pgp
Description: PGP signature

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux