summaryrefslogtreecommitdiff
path: root/kerberosIV
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-03-09 20:11:53 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-03-09 20:11:53 +0000
commit38d6626386175b09def8ea306ba9c019e0062aec (patch)
tree5c44ce624c40449415fc2fab2774af21dfbc7ead /kerberosIV
parentce07866a275a5b5d1f76a184342555629011994b (diff)
Attempt to get the canonical name of a host before doing realm lookup, it
might be a CNAME which does not match anything we know about
Diffstat (limited to 'kerberosIV')
-rw-r--r--kerberosIV/krb/getrealm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kerberosIV/krb/getrealm.c b/kerberosIV/krb/getrealm.c
index 45f6e260b11..ebd6ad164bc 100644
--- a/kerberosIV/krb/getrealm.c
+++ b/kerberosIV/krb/getrealm.c
@@ -28,6 +28,7 @@ or implied warranty.
*/
#include "krb_locl.h"
+#include <netdb.h>
#define MATCH_SUBDOMAINS 0
@@ -64,8 +65,12 @@ krb_realmofhost(host)
FILE *trans_file;
char trans_host[MAXHOSTNAMELEN+1];
char trans_realm[REALM_SZ+1];
+ struct hostent *hp;
int retval;
+ if ((hp = gethostbyname(host)) != NULL)
+ host = hp->h_name;
+
domain = strchr(host, '.');
/* prepare default */