diff options
author | Theodore Tso <tytso@mit.edu> | 1999-01-05 05:39:44 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1999-01-05 05:39:44 +0000 |
commit | ee3a7528633657e0421b37b26a7fbd9ee3705293 (patch) | |
tree | 9bc17956a695e67d86cd919e43919937b5c2b544 /src/lib | |
parent | 9b2f90f549cf089df6a701f8ab0718fc36678334 (diff) | |
download | krb5-ee3a7528633657e0421b37b26a7fbd9ee3705293.tar.gz krb5-ee3a7528633657e0421b37b26a7fbd9ee3705293.tar.xz krb5-ee3a7528633657e0421b37b26a7fbd9ee3705293.zip |
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
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/krb5/os/ChangeLog | 7 | ||||
-rw-r--r-- | src/lib/krb5/os/sn2princ.c | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index c94a4f789a..71e0eb275f 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 <tytso@mit.edu> + + * 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 <tytso@mit.edu> * 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 1cb133761c..f21885929f 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; |