* stdcc.c (krb5_stdcc_destroy): Do not mask KRB5_FCC_NOFILE error
authorDanilo Almeida <dalmeida@mit.edu>
Thu, 16 Mar 2000 00:44:18 +0000 (00:44 +0000)
committerDanilo Almeida <dalmeida@mit.edu>
Thu, 16 Mar 2000 00:44:18 +0000 (00:44 +0000)
on destroy.

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

src/lib/krb5/ccache/ccapi/ChangeLog
src/lib/krb5/ccache/ccapi/stdcc.c

index a97d97f009ec8cfa271fe9cf5ede03b1363b2749..e4dac98dd84becd97f750dac4c20f6d21a4bcee2 100644 (file)
@@ -1,3 +1,8 @@
+2000-03-15  Danilo Almeida  <dalmeida@mit.edu>
+
+       * stdcc.c (krb5_stdcc_destroy): Do not mask KRB5_FCC_NOFILE error
+       on destroy.
+
 2000-02-10  Miro Jurisic <meeroh@mit.edu>
 
        * stdcc_util.c: Fixed lxs' fix
index ed233b068fe16ac8a410d82cd341e542a6cc0b45..a17cd02650791b0d0c4cb9fec7bb0d14c78f8fd2 100644 (file)
@@ -620,13 +620,11 @@ krb5_stdcc_destroy (krb5_context context, krb5_ccache id)
        int err;
        krb5_error_code retval;
        stdccCacheDataPtr       ccapi_data = id->data;
-       
+
        if ((retval = stdcc_setup(context, ccapi_data))) {
-               if (retval == KRB5_FCC_NOFILE)
-                       return 0;
                return retval;
        }
-       
+
        /* free memory associated with the krb5_ccache */
        if (ccapi_data) {
                if (ccapi_data->cache_name)
@@ -634,14 +632,20 @@ krb5_stdcc_destroy (krb5_context context, krb5_ccache id)
                if (ccapi_data->NamedCache) {
                        /* destroy the named cache */
                        err = cc_destroy(gCntrlBlock, &ccapi_data->NamedCache);
+                       retval = cc_err_xlate(err);
                        cache_changed();
                }
                free(ccapi_data);
                id->data = NULL;
        }
        free(id);
-       
-       return cc_err_xlate(err);
+
+       /* If the cache does not exist when we tried to destroy it,
+          that's fine.  That means someone else destryoed it since
+          we resolved it. */
+       if (retval == KRB5_FCC_NOFILE)
+               return 0;
+       return retval;
 }
 
 /*