From owner-freebsd-bugs Thu Feb 11 08:00:06 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA05975 for freebsd-bugs-outgoing; Thu, 11 Feb 1999 08:00:06 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA05920 for ; Thu, 11 Feb 1999 08:00:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id IAA78763; Thu, 11 Feb 1999 08:00:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA05155; Thu, 11 Feb 1999 07:52:15 -0800 (PST) (envelope-from nobody) Message-Id: <199902111552.HAA05155@hub.freebsd.org> Date: Thu, 11 Feb 1999 07:52:15 -0800 (PST) From: mystify@friley-184-92.res.iastate.edu To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/10030: Kerberized telnet fails to encrypt when a hostname alias is used (patch included) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 10030 >Category: bin >Synopsis: Kerberized telnet fails to encrypt when a hostname alias is used (patch included) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 11 08:00:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Patrick Hartling >Release: 4.0-current >Organization: ICEMT >Environment: FreeBSD friley-184-92.res.iastate.edu 4.0-CURRENT FreeBSD 4.0-CURRENT #0: Wed Feb 10 10:53:07 CST 1999 mystify@friley-184-92.res.iastate.edu:/usr/src/sys/compile/xDOGBERT i386 >Description: If 'telnet -ax' is used with a hostname that is an alias for a machine's actual hostname, Kerberos encryption fails. This can happen when an alias cycles through several IP addresses. For example, isua.iastate.edu is an alias for isua[1-5].iastate.edu >How-To-Repeat: Do 'telnet -ax ' where is an alias. >Fix: The following patch fixes the problem: *** crypto/telnet/telnet/commands.c.orig Tue Feb 9 21:09:38 1999 --- crypto/telnet/telnet/commands.c Tue Feb 9 21:53:43 1999 *************** *** 2382,2387 **** --- 2382,2395 ---- memmove((caddr_t)&sin.sin_addr, host->h_addr, host->h_length); #endif /* defined(h_addr) */ strncpy(_hostname, host->h_name, sizeof(_hostname)); + + /* Ensure that we have the real hostname. */ + host = gethostbyaddr((char*) &sin.sin_addr, + sizeof(sin.sin_addr), AF_INET); + if ( host ) { + strncpy(_hostname, host->h_name, sizeof(_hostname)); + } + _hostname[sizeof(_hostname)-1] = '\0'; hostname = _hostname; } else { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message