From 87ff624d40218a193f89add6d5d5755586dff8ab Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Sun, 10 Nov 1996 23:48:51 +0000 Subject: Call gethostbyaddr over what we connect to to get the Kerberos principal to use; if that fails, fall back on what gethostbyname returns earlier. [170] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9363 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/telnet/telnet/commands.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/appl/telnet/telnet/commands.c') diff --git a/src/appl/telnet/telnet/commands.c b/src/appl/telnet/telnet/commands.c index 740be8aa7f..b187f3d358 100644 --- a/src/appl/telnet/telnet/commands.c +++ b/src/appl/telnet/telnet/commands.c @@ -2554,6 +2554,13 @@ tn(argc, argv) return 0; } connected++; + host = gethostbyaddr((char *) &sin.sin_addr, sizeof(struct in_addr), sin.sin_family); + if (host) { + strncpy(_hostname, host->h_name, sizeof(_hostname)); + _hostname[sizeof(_hostname)-1] = '\0'; + hostname = _hostname; + } + #if defined(AUTHENTICATION) || defined(ENCRYPTION) auth_encrypt_connect(connected); #endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */ -- cgit