sn2princ.c (krb5_sname_to_principal): Windows NT5's broken resolver
authorTheodore Tso <tytso@mit.edu>
Tue, 5 Jan 1999 05:39:44 +0000 (05:39 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 5 Jan 1999 05:39:44 +0000 (05:39 +0000)
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

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/sn2princ.c

index c94a4f789a8f4c019ea8b31ee4a6c9bf58ed3612..71e0eb275ffad9b13299a5292de2665f644e0a57 100644 (file)
@@ -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
index 1cb133761cb1f37ee251f11f7415c39e01dea457..f21885929f9a9156d686431658ac2f833748a73b 100644 (file)
@@ -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;