summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1996-03-09 20:11:52 +0000
committertholo <tholo@openbsd.org>1996-03-09 20:11:52 +0000
commit9116f0b7c2c841ef4cbfc02d4a92b1130ef459eb (patch)
treec875699fb101487286455d6e02efafa798b185dd
parentMake building with ${HOSTCC} work in obj-dirs (diff)
downloadwireguard-openbsd-9116f0b7c2c841ef4cbfc02d4a92b1130ef459eb.tar.xz
wireguard-openbsd-9116f0b7c2c841ef4cbfc02d4a92b1130ef459eb.zip
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
-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 f4bd245e59a..4b3e0e92762 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 */