Fix error code returned for empty sequences and check the error
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 17 Sep 2004 07:33:30 +0000 (07:33 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 17 Sep 2004 07:33:30 +0000 (07:33 +0000)
  in krb5_lcc_initialize

ticket: 2705
status: open

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

src/lib/krb5/ccache/ChangeLog
src/lib/krb5/ccache/cc_mslsa.c

index 1d51b69fa567302e09baa9848fb31ddd1153c728..11ac8d80fd8a9d380faa9d138e9497d6a0157aea 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-17  Jeffrey Altman <jaltman@mit.edu>
+        * cc_mslsa.c: Fix the error returned when krb5_lcc_start_seq_get()
+          discovers the cache is empty.  Check for the new error in 
+          krb5_lcc_initialize()
+
 2004-09-10  Jeffrey Altman <jaltman@mit.edu>
         * cc_mslsa.c: Implement krb5_lcc_initialize()
           Remove all tickets from the cache which have a client
index f594c895acb11725c2e98d54a775e62effdaf4c8..f35a594991539561f4eea8882c94d7840b3ea639 100644 (file)
@@ -1936,8 +1936,11 @@ krb5_lcc_initialize(krb5_context context, krb5_ccache id, krb5_principal princ)
         return KRB5_FCC_NOFILE;
 
     code = krb5_cc_start_seq_get(context, id, &cursor);
-    if (code)
+    if (code) {
+        if (code == KRB5_CC_NOTFOUND)
+            return KRB5_OK;
         return code;
+    }
 
     while ( !(code = krb5_cc_next_cred(context, id, &cursor, &cred)) )
     {
@@ -2041,7 +2044,7 @@ krb5_lcc_start_seq_get(krb5_context context, krb5_ccache id, krb5_cc_cursor *cur
     if (!GetMSTGT(context, data->LogonHandle, data->PackageId, &lcursor->mstgt, TRUE)) {
         free(lcursor);
         *cursor = 0;
-        return KRB5_FCC_INTERNAL;
+        return KRB5_CC_NOTFOUND;
     }
 
 #ifdef HAVE_CACHE_INFO_EX2