From nobody  Thu Feb 11 07:52:15 1999
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
Subject: Kerberized telnet fails to encrypt when a hostname alias is used (patch included)
X-Send-Pr-Version: www-1.0

>Number:         10030
>Category:       bin
>Synopsis:       [patch] Kerberized telnet fails to encrypt when a hostname alias is used
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    markm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 11 08:00:01 PST 1999
>Closed-Date:    Mon Aug 26 12:54:21 UTC 2013
>Last-Modified:  Mon Aug 26 12:54:21 UTC 2013
>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 <hostname>' where <hostname> 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:

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: mystify@friley-184-92.res.iastate.edu
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/10030: Kerberized telnet fails to encrypt when a hostname alias is used (patch included) 
Date: Tue, 22 Jun 1999 13:16:54 +0200

 Hi Patrick,
 
 It looks like you cut'n'pasted your patch, because the whitespace has
 gone for a ball of chalk.
 
 I've included a fixed version of your patch here.
 
 Ciao,
 Sheldon.
 
 PS: You'll notice I left out a pair of braces, changed your runover
     indentation and removed the blank lines and comment. I did this to
     make the patch fit the style of the original source.
 
 Index: commands.c
 ===================================================================
 RCS file: /home/ncvs/src/crypto/telnet/telnet/commands.c,v
 retrieving revision 1.2
 diff -u -d -r1.2 commands.c
 --- commands.c	1997/09/07 07:02:08	1.2
 +++ commands.c	1999/06/22 11:12:59
 @@ -2382,6 +2382,10 @@
  		memmove((caddr_t)&sin.sin_addr, host->h_addr, host->h_length);
  #endif	/* defined(h_addr) */
  		strncpy(_hostname, host->h_name, sizeof(_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 {
 
Responsible-Changed-From-To: freebsd-bugs->markm 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Thu Jun 24 04:33:51 PDT 1999 
Responsible-Changed-Why:  
Mark, the crypto stuff is yours, right? Note that the submitter's 
e-mail address bounces mail. :-( 
State-Changed-From-To: open->closed 
State-Changed-By: markm 
State-Changed-When: Mon Aug 26 12:53:25 UTC 2013 
State-Changed-Why:  
Stale. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=10030 
>Unformatted:
