Add stub function implementations to support krb5_cc_remove_cred() which
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 6 Jan 2004 23:21:13 +0000 (23:21 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 6 Jan 2004 23:21:13 +0000 (23:21 +0000)
would cause a null pointer dereference if called.  The new KRB5_CC_NOSUPP
error is returned to indicate the lack of implementation.

ticket: 2106
target_version: 1.3.2
tags: pullup

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

src/lib/krb5/ccache/ChangeLog
src/lib/krb5/ccache/cc_file.c
src/lib/krb5/ccache/cc_memory.c
src/lib/krb5/ccache/cc_mslsa.c
src/lib/krb5/error_tables/ChangeLog
src/lib/krb5/error_tables/krb5_err.et

index 71158eaf3a6d914f4435a1e052021c99064a55c4..e6cb33895796aceb2d1cc8711a32583c5a6a0fe3 100644 (file)
@@ -1,3 +1,12 @@
+2004-01-06  Jeffrey Altman <jaltman@mit.edu>
+
+   * cc_file.c, cc_memory.c:
+     Add stub implementations for unimplemented krb5_cc_remove_cred()
+     Returns KRB5_CC_NOSUPP
+
+   * cc_mslsa.c:
+     Add implementation for krb5_cc_remove_cred().  Returns KRB5_CC_READONLY.
+
 2003-12-19  Jeffrey Altman <jaltman@mit.edu>
               
    * cc_mslsa.c: fix indirection of a krb5_creds structure which
index 09ce8d55e2b059ea748386d15dd48e726f1f7bad..a9b45647a0c2017a4c4918f93924b7612e880bff 100644 (file)
@@ -2254,6 +2254,18 @@ lose:
 #undef TCHECK
 }
 
+/* 
+ * Non-functional stub implementation for krb5_fcc_remove
+ * 
+ * Errors:
+ *    KRB5_CC_NOSUPP - not implemented
+ */
+static krb5_error_code KRB5_CALLCONV
+krb5_fcc_remove_cred(krb5_context context, krb5_ccache cache, krb5_flags flags,
+                     krb5_creds *creds)
+{
+    return KRB5_CC_NOSUPP;
+}
 
 /*
  * Requires:
@@ -2362,7 +2374,7 @@ const krb5_cc_ops krb5_fcc_ops = {
      krb5_fcc_start_seq_get,
      krb5_fcc_next_cred,
      krb5_fcc_end_seq_get,
-     NULL, /* XXX krb5_fcc_remove, */
+     krb5_fcc_remove,
      krb5_fcc_set_flags,
 };
 
@@ -2422,6 +2434,6 @@ const krb5_cc_ops krb5_cc_file_ops = {
      krb5_fcc_start_seq_get,
      krb5_fcc_next_cred,
      krb5_fcc_end_seq_get,
-     NULL, /* XXX krb5_fcc_remove, */
+     krb5_fcc_remove,
      krb5_fcc_set_flags,
 };
index 97ec32752d732c55138549fcbfc6ef505cb29605..8477e3d4589c4c7fbbba6962569c7c866395db78 100644 (file)
@@ -519,6 +519,20 @@ krb5_mcc_store(krb5_context context, krb5_ccache id, krb5_creds *creds)
      return ret;
 }
 
+/* 
+ * Non-functional stub implementation for krb5_mcc_remove
+ * 
+ * Errors:
+ *    KRB5_CC_NOSUPP - not implemented
+ */
+static krb5_error_code KRB5_CALLCONV
+krb5_mcc_remove_cred(krb5_context context, krb5_ccache cache, krb5_flags flags,
+                     krb5_creds *creds)
+{
+    return KRB5_CC_NOSUPP;
+}
+
+
 /*
  * Requires:
  * id is a cred cache returned by krb5_mcc_resolve or
@@ -553,6 +567,6 @@ const krb5_cc_ops krb5_mcc_ops = {
      krb5_mcc_start_seq_get,
      krb5_mcc_next_cred,
      krb5_mcc_end_seq_get,
-     NULL, /* XXX krb5_mcc_remove, */
+     krb5_mcc_remove,
      krb5_mcc_set_flags,
 };
index 6d1dfc5a4ac088e09fc09ce8d301c12077a11a26..3ceda5a09ec803b5852e1a4a05642d4a7025e846 100644 (file)
@@ -1386,6 +1386,19 @@ krb5_lcc_store(krb5_context context, krb5_ccache id, krb5_creds *creds)
     return KRB5_CC_READONLY;
 }
 
+/* 
+ * The ability to remove a credential from the MS LSA cache cannot be implemented.
+ * 
+ * Errors:
+ *    KRB5_CC_READONLY: 
+ */
+static krb5_error_code KRB5_CALLCONV
+krb5_fcc_remove_cred(krb5_context context, krb5_ccache cache, krb5_flags flags,
+                     krb5_creds *creds)
+{
+    return KRB5_CC_READONLY;
+}
+
 
 /*
  * Effects:
@@ -1412,7 +1425,7 @@ const krb5_cc_ops krb5_lcc_ops = {
      krb5_lcc_start_seq_get,
      krb5_lcc_next_cred,
      krb5_lcc_end_seq_get,
-     NULL, /* krb5_lcc_remove, */
+     krb5_lcc_remove,
      krb5_lcc_set_flags
 };
 #endif /* _WIN32 */
\ No newline at end of file
index c5f1371b85e6d8e4b389827b456152f67c6b1a7e..7fea34e6caee63b36f36b57d61e7c479a639e3e2 100644 (file)
@@ -1,3 +1,7 @@
+2004-01-06  Jeffrey Altman <jaltman@mit.edu>
+
+    * krb5_err.et (KRB5_CC_NOSUPP) new ccache error code
+
 2003-12-12  Jeffrey Altman <jaltman@mit.edu>
 
     * krb5_err.et (KRB5_CC_READONLY) new ccache error code
index 622143b7de2a1483ae9ea589d59298340e477bbc..b03d3769d94f18b827462615d44b69cffe3ba217 100644 (file)
@@ -339,5 +339,5 @@ error_code KRB5_ERR_BAD_S2K_PARAMS, "Invalid key generation parameters from KDC"
 error_code KRB5_ERR_NO_SERVICE,        "service not available"
 
 error_code KRB5_CC_READONLY,    "Ccache function not supported: read-only ccache type"
-
+error_code KRB5_CC_NOSUPP,      "Ccache function not supported: not implemented"
 end