kim_ccache_get_display_name was calling kim_ccache_create_resolve_name with its param...
authorJustin Anderson <jander@mit.edu>
Tue, 23 Sep 2008 19:40:52 +0000 (19:40 +0000)
committerJustin Anderson <jander@mit.edu>
Tue, 23 Sep 2008 19:40:52 +0000 (19:40 +0000)
kim_ccache_iterator_next wasn't handling the end of iteration correctly.

ticket:6055

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

src/kim/lib/kim_ccache.c

index 5831a66ad975b7f429920649fca2f5049e2b761e..dd6bdf77dc45ea4d19c7333b1d8a5060ecda940c 100644 (file)
@@ -87,14 +87,14 @@ kim_error kim_ccache_iterator_next (kim_ccache_iterator  in_ccache_iterator,
                                                        in_ccache_iterator->cursor,
                                                        &ccache);
         
-        if (!terr) {
+        if (ccache) {
             err = kim_ccache_create_from_krb5_ccache (out_ccache,
                                                       in_ccache_iterator->context, 
                                                       ccache);
-        } else if (terr == KRB5_CC_END) {
-            *out_ccache = NULL; /* no more ccaches */
-            
         } else {
+            *out_ccache = NULL; /* no more ccaches */
+        }
+        if (terr && terr != KRB5_CC_END) {
             err = krb5_error (in_ccache_iterator->context, terr);
         }
     }
@@ -598,7 +598,7 @@ kim_error kim_ccache_get_display_name (kim_ccache  in_ccache,
         kim_string name = krb5_cc_get_name (in_ccache->context, 
                                             in_ccache->ccache);
         
-        err = kim_ccache_create_resolve_name (out_display_name, type, name);
+        err = kim_ccache_create_resolve_name (out_display_name, name, type);
     }
     
     return check_error (err);