summaryrefslogtreecommitdiffstats
path: root/src/appl/telnet/telnet/commands.c
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>1996-11-10 23:48:51 +0000
committerSam Hartman <hartmans@mit.edu>1996-11-10 23:48:51 +0000
commit87ff624d40218a193f89add6d5d5755586dff8ab (patch)
tree19269a29dd732fd1a41eef9389bf5df533f32be7 /src/appl/telnet/telnet/commands.c
parentd2621a293f2e2cd7ba776dd0ea69f2f2b6647173 (diff)
downloadkrb5-87ff624d40218a193f89add6d5d5755586dff8ab.tar.gz
krb5-87ff624d40218a193f89add6d5d5755586dff8ab.tar.xz
krb5-87ff624d40218a193f89add6d5d5755586dff8ab.zip
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
Diffstat (limited to 'src/appl/telnet/telnet/commands.c')
-rw-r--r--src/appl/telnet/telnet/commands.c7
1 files changed, 7 insertions, 0 deletions
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) */