Call gethostbyaddr over what we connect to to get the Kerberos principal to
authorSam Hartman <hartmans@mit.edu>
Sun, 10 Nov 1996 23:48:51 +0000 (23:48 +0000)
committerSam Hartman <hartmans@mit.edu>
Sun, 10 Nov 1996 23:48:51 +0000 (23:48 +0000)
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/ChangeLog
src/appl/telnet/telnet/commands.c

index af36a6cf79b3aa1d597b1f6e412822e0db45e661..96a6246dcb2b129bffb81155bbf470e3e6f8bbdb 100644 (file)
@@ -1,3 +1,8 @@
+Sun Nov 10 17:34:40 1996  Sam Hartman  <hartmans@mit.edu>
+
+       * commands.c (tn): Reverse resolve address to deal with dialup
+       pools [krb5-libs/170]
+
 Fri Nov  1 00:49:21 1996  Sam Hartman  <hartmans@mit.edu>
 
        * main.c: Implement Type Of Service patch from jhawk. [57]
index 740be8aa7f7eb89cea910c6963f96e6cae07b73c..b187f3d35832dbe895e8ed2d64ecfc5bde3ecccf 100644 (file)
@@ -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) */