From: Theodore Tso Date: Tue, 5 Jan 1999 05:39:44 +0000 (+0000) Subject: sn2princ.c (krb5_sname_to_principal): Windows NT5's broken resolver X-Git-Tag: krb5-1.1-beta1~420 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ee3a7528633657e0421b37b26a7fbd9ee3705293;p=krb5.git sn2princ.c (krb5_sname_to_principal): Windows NT5's broken resolver gratuitously tacks on a trailing period to the hostname (at least it does in Beta2). Deal with this brain-damage. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11102 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index c94a4f789..71e0eb275 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,10 @@ +Tue Jan 5 00:11:49 1999 Theodore Y. Ts'o + + * sn2princ.c (krb5_sname_to_principal): Windows NT5's broken + resolver gratuitously tacks on a trailing period to the + hostname (at least it does in Beta2). Deal with this + brain-damage. + Tue Dec 22 01:22:24 1998 Theodore Y. Ts'o * changepw.c: Add a test for _WIN16 as well as _WIN32 for sockets diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c index 1cb133761..f21885929 100644 --- a/src/lib/krb5/os/sn2princ.c +++ b/src/lib/krb5/os/sn2princ.c @@ -99,6 +99,18 @@ krb5_sname_to_principal(context, hostname, sname, type, ret_princ) if (isupper(*cp)) *cp = tolower(*cp); + /* + * Windows NT5's broken resolver gratuitously tacks on a + * trailing period to the hostname (at least it does in + * Beta2). Find and remove it. + */ + if (remote_host[0]) { + cp = remote_host + strlen(remote_host)-1; + if (*cp == '.') + *cp = 0; + } + + if (retval = krb5_get_host_realm(context, remote_host, &hrealms)) { free(remote_host); return retval;