ports/security/openssh-portable/files/patch-ssh.c
Florian Smeets 9b3fe7c2f4 - update to 5.8p2 [1]
- fix Kerberos knob [2]
- fix build on 9.0 [3]
- fix deinstall with various knobs [4]
- fix LPK knob [5]

PR:		ports/161818 [1], ports/144597 [2], ports/160389 [3]
		ports/150493, ports/156926 [4], ports/155456 [5]

Submitted by:	"Grzegorz Blach" <magik@roorback.net> [1], [2], [4], [5]
		pluknet [3]
Reported by:	Jonathan <lordsith49@hotmail.com> [2]
		Kevin Thompson <antiduh@csh.rit.edu> [4]
		Alexey Remizov <alexey@remizov.org> [5]
2011-10-21 16:18:56 +00:00

30 lines
782 B
C

$FreeBSD$
Make the same change to use the canonical hostname as the base FreeBSD ssh.
--- ssh.c.orig 2010-08-16 09:59:31.000000000 -0600
+++ ssh.c 2010-08-25 17:55:01.000000000 -0600
@@ -699,6 +699,23 @@
"h", host, (char *)NULL);
}
+ /* Find canonic host name. */
+ if (strchr(host, '.') == 0) {
+ struct addrinfo hints;
+ struct addrinfo *ai = NULL;
+ int errgai;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = options.address_family;
+ hints.ai_flags = AI_CANONNAME;
+ hints.ai_socktype = SOCK_STREAM;
+ errgai = getaddrinfo(host, NULL, &hints, &ai);
+ if (errgai == 0) {
+ if (ai->ai_canonname != NULL)
+ host = xstrdup(ai->ai_canonname);
+ freeaddrinfo(ai);
+ }
+ }
+
if (options.local_command != NULL) {
char thishost[NI_MAXHOST];