Fix to srvmatch so that when comparing the server, we ignore the realm for
authorTheodore Tso <tytso@mit.edu>
Thu, 18 Aug 1994 20:38:48 +0000 (20:38 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 18 Aug 1994 20:38:48 +0000 (20:38 +0000)
the purposes of the comparison.  This used to be the what this worked, but it
was broken in the krb5 principal cutover long ago.  Since we weren't doing
cross-realm authentication, no one noticed....

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4185 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/file/ChangeLog
src/lib/krb5/ccache/file/fcc_retrv.c
src/lib/krb5/ccache/stdio/ChangeLog
src/lib/krb5/ccache/stdio/scc_retrv.c

index 587798143dada5a503b967789f7a8c40a9de9dcd..97748b5d21bfb174ec0095615a693f1573dbd40d 100644 (file)
@@ -1,3 +1,9 @@
+Thu Aug 18 16:33:33 1994  Theodore Y. Ts'o  (tytso at tsx-11)
+
+       * fcc_retrv.c (srvname_match): Fix bug in srvname_match where so
+       that the server realm is really ignored in the compare, like it's
+       supposed to be.
+
 Mon Jun 20 19:36:19 1994  Theodore Y. Ts'o  (tytso at tsx-11)
 
        * fcc.h: #include <krb5/osconf.h> so that build works using imake.
index 134e4ff959c5701afa5e961f9b247f348043d023..dceac5d152970642672ec5a163df8d60c501e4ea 100644 (file)
@@ -180,10 +180,18 @@ srvname_match(mcreds, creds)
 register const krb5_creds *mcreds, *creds;
 {
     krb5_boolean retval;
+    krb5_principal_data p1, p2;
+    
     retval = krb5_principal_compare(mcreds->client,creds->client);
     if (retval != TRUE)
        return retval;
-    return krb5_principal_compare(mcreds->server, creds->server);
+    /*
+     * Hack to ignore the server realm for the purposes of the compare.
+     */
+    p1 = *mcreds->server;
+    p2 = *creds->server;
+    p1.realm = p2.realm;
+    return krb5_principal_compare(&p1, &p2);
 }
 
 static krb5_boolean
index 22070133e21cf353ad63661156476122d17aba74..56d6d4fb3b4c302116f76a685cf9730bf3ffe527 100644 (file)
@@ -1,3 +1,9 @@
+Thu Aug 18 16:34:51 1994  Theodore Y. Ts'o  (tytso at tsx-11)
+
+       * scc_retrv.c (srvname_match): Fix bug in srvname_match where so
+       that the server realm is really ignored in the compare, like it's
+       supposed to be.
+
 Tue Aug  2 04:07:17 1994  Tom Yu  (tlyu@dragons-lair)
 
        * scc_maybe.c (krb5_scc_open_file): changed an #ifdef from
index 5ee4237372fdc93e1eeef63eb80aaa466ce1218a..071bd30052e6f32f9e8f303fc3fad661b04a7ea3 100644 (file)
@@ -78,10 +78,18 @@ srvname_match(mcreds, creds)
 register const krb5_creds *mcreds, *creds;
 {
     krb5_boolean retval;
+    krb5_principal_data p1, p2;
+    
     retval = krb5_principal_compare(mcreds->client,creds->client);
     if (retval != TRUE)
        return retval;
-    return krb5_principal_compare(mcreds->server, creds->server);
+    /*
+     * Hack to ignore the server realm for the purposes of the compare.
+     */
+    p1 = *mcreds->server;
+    p2 = *creds->server;
+    p1.realm = p2.realm;
+    return krb5_principal_compare(&p1, &p2);
 }