svn rev #24170: trunk/src/ include/ kdc/ lib/kdb/ plugins/kdb/db2/ plugins/kdb/ldap/libkdb_ldap/
ghudson@MIT.EDU
ghudson at MIT.EDU
Sat Jul 3 15:02:41 EDT 2010
http://src.mit.edu/fisheye/changelog/krb5/?cs=24170
Commit By: ghudson
Log Message:
ticket: 6749
status: open
Use KRB5_PLUGIN_OP_NOTSUPP uniformly as the error code for operations
not supported by a KDB module. (Previously KRB5_KDB_DBTYPE_NOSUP was
used in some cases and KRB5_PLUGIN_OP_NOTSUPP in others.)
Changed Files:
U trunk/src/include/kdb.h
U trunk/src/kdc/kdc_authdata.c
U trunk/src/kdc/kdc_util.c
U trunk/src/kdc/policy.c
U trunk/src/lib/kdb/kdb5.c
U trunk/src/plugins/kdb/db2/kdb_ext.c
U trunk/src/plugins/kdb/ldap/libkdb_ldap/kdb_ext.c
Modified: trunk/src/include/kdb.h
===================================================================
--- trunk/src/include/kdb.h 2010-07-03 15:23:45 UTC (rev 24169)
+++ trunk/src/include/kdb.h 2010-07-03 19:02:41 UTC (rev 24170)
@@ -824,7 +824,7 @@
* Some module functions are mandatory for KDC operation; others are optional
* or apply only to administrative operations. If a function is optional, a
* module can leave the function pointer as NULL. Alternatively, modules can
- * return KRB5_KDB_DBTYPE_NOSUP when asked to perform an inapplicable action.
+ * return KRB5_PLUGIN_OP_NOTSUPP when asked to perform an inapplicable action.
*
* Some module functions have default implementations which will call back into
* the vtable interface. Leave these functions as NULL to use the default
@@ -916,9 +916,8 @@
*
* Used by the "kadmin lock" command, incremental propagation, and
* kdb5_util dump. Incremental propagation support requires shared locks
- * to operate. kdb5_util dump will work if the module returns
- * KRB5_PLUGIN_OP_NOTSUPP; note that this is *not* the usual "operation
- * not supported" error code.
+ * to operate. kdb5_util dump will continue unlocked if the module returns
+ * KRB5_PLUGIN_OP_NOTSUPP.
*/
krb5_error_code (*lock)(krb5_context kcontext, int mode);
@@ -1201,9 +1200,8 @@
* invokes this function when the load is complete, thus replacing the live
* database with no loss of read availability.
*
- * The default implementation returns KRB5_PLUGIN_OP_NOTSUPP (which is
- * *not* the usual "operation not supported" error code); kdb5_util dump
- * recognizes and ignores this error code.
+ * The default implementation returns KRB5_PLUGIN_OP_NOTSUPP; kdb5_util
+ * dump recognizes and ignores this error code.
*/
krb5_error_code (*promote_db)(krb5_context context, char *conf_section,
char **db_args);
@@ -1244,7 +1242,7 @@
/*
* Optional: Perform an operation on input data req with output stored in
- * rep. Return KRB5_KDB_DBTYPE_NOSUP if the module does not implement the
+ * rep. Return KRB5_PLUGIN_OP_NOTSUPP if the module does not implement the
* method. Defined methods are:
*
* KRB5_KDB_METHOD_SIGN_AUTH_DATA: req contains a krb5_sign_auth_data_req
@@ -1260,7 +1258,7 @@
* KRB5_KDB_METHOD_CHECK_TRANSITED_REALMS: req contains a
* kdb_check_transited_realms_req structure. Perform a policy check on
* a cross-realm ticket's transited field and return an error (other
- * than KRB5_KDB_DBTYPE_NOSUP) if the check fails. Leave rep alone.
+ * than KRB5_PLUGIN_OP_NOTSUPP) if the check fails. Leave rep alone.
*
* KRB5_KDB_METHOD_CHECK_POLICY_AS: req contains a kdb_check_policy_as_req
* structure. Perform a policy check on an AS request, in addition to
Modified: trunk/src/kdc/kdc_authdata.c
===================================================================
--- trunk/src/kdc/kdc_authdata.c 2010-07-03 15:23:45 UTC (rev 24169)
+++ trunk/src/kdc/kdc_authdata.c 2010-07-03 19:02:41 UTC (rev 24170)
@@ -741,7 +741,7 @@
FALSE); /* !ignore_kdc_issued */
if (code != 0)
krb5_free_authdata(context, db_authdata);
- } else if (code == KRB5_KDB_DBTYPE_NOSUP)
+ } else if (code == KRB5_PLUGIN_OP_NOTSUPP)
code = 0;
return code;
Modified: trunk/src/kdc/kdc_util.c
===================================================================
--- trunk/src/kdc/kdc_util.c 2010-07-03 15:23:45 UTC (rev 24169)
+++ trunk/src/kdc/kdc_util.c 2010-07-03 19:02:41 UTC (rev 24170)
@@ -2294,7 +2294,7 @@
KRB5_KDB_METHOD_CHECK_ALLOWED_TO_DELEGATE,
&req_data,
&rep_data);
- if (code == KRB5_KDB_DBTYPE_NOSUP) {
+ if (code == KRB5_PLUGIN_OP_NOTSUPP) {
code = KRB5KDC_ERR_POLICY;
}
@@ -2380,7 +2380,7 @@
KRB5_KDB_METHOD_CHECK_TRANSITED_REALMS,
&req_data,
&rep_data);
- if (code == KRB5_KDB_DBTYPE_NOSUP) {
+ if (code == KRB5_PLUGIN_OP_NOTSUPP) {
code = 0;
}
Modified: trunk/src/kdc/policy.c
===================================================================
--- trunk/src/kdc/policy.c 2010-07-03 15:23:45 UTC (rev 24169)
+++ trunk/src/kdc/policy.c 2010-07-03 19:02:41 UTC (rev 24170)
@@ -95,7 +95,7 @@
KRB5_KDB_METHOD_CHECK_POLICY_AS,
&req_data,
&rep_data);
- if (code == KRB5_KDB_DBTYPE_NOSUP)
+ if (code == KRB5_PLUGIN_OP_NOTSUPP)
return 0;
*status = rep.status;
@@ -153,7 +153,7 @@
KRB5_KDB_METHOD_CHECK_POLICY_TGS,
&req_data,
&rep_data);
- if (code == KRB5_KDB_DBTYPE_NOSUP)
+ if (code == KRB5_PLUGIN_OP_NOTSUPP)
return 0;
*status = rep.status;
Modified: trunk/src/lib/kdb/kdb5.c
===================================================================
--- trunk/src/lib/kdb/kdb5.c 2010-07-03 15:23:45 UTC (rev 24169)
+++ trunk/src/lib/kdb/kdb5.c 2010-07-03 19:02:41 UTC (rev 24170)
@@ -292,7 +292,7 @@
krb5_set_error_message(kcontext, KRB5_KDB_DBTYPE_NOTFOUND,
"Unable to find requested database type: %s",
lib_name);
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
}
lib = calloc(1, sizeof(*lib));
@@ -634,7 +634,7 @@
if (status)
goto clean_n_exit;
if (v->create == NULL) {
- status = KRB5_KDB_DBTYPE_NOSUP;
+ status = KRB5_PLUGIN_OP_NOTSUPP;
goto clean_n_exit;
}
status = v->create(kcontext, section, db_args);
@@ -685,7 +685,7 @@
if (status)
goto clean_n_exit;
if (v->destroy == NULL) {
- status = KRB5_KDB_DBTYPE_NOSUP;
+ status = KRB5_PLUGIN_OP_NOTSUPP;
goto clean_n_exit;
}
status = v->destroy(kcontext, section, db_args);
@@ -706,7 +706,7 @@
if (status)
return status;
if (v->get_age == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->get_age(kcontext, db_name, t);
}
@@ -720,7 +720,7 @@
if (status)
return status;
if (v->lock == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->lock(kcontext, lock_mode);
}
@@ -734,7 +734,7 @@
if (status)
return status;
if (v->unlock == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->unlock(kcontext);
}
@@ -751,7 +751,7 @@
if (status)
return status;
if (v->get_principal == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->get_principal(kcontext, search_for, 0, entries, nentries, more);
}
@@ -769,7 +769,7 @@
if (status)
return status;
if (v->get_principal == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->get_principal(kcontext, search_for, flags, entries, nentries,
more);
}
@@ -878,7 +878,7 @@
if (status)
return status;
if (v->put_principal == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
status = extract_db_args_from_tl_data(kcontext, &entries->tl_data,
&entries->n_tl_data,
&db_args);
@@ -949,7 +949,7 @@
}
if (v->put_principal == NULL) {
- status = KRB5_KDB_DBTYPE_NOSUP;
+ status = KRB5_PLUGIN_OP_NOTSUPP;
goto err_lock;
}
@@ -986,7 +986,7 @@
if (status)
return status;
if (v->delete_principal == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->delete_principal(kcontext, search_for, nentries);
}
@@ -1033,7 +1033,7 @@
}
if (v->delete_principal == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
status = v->delete_principal(kcontext, search_for, nentries);
@@ -1089,7 +1089,7 @@
if (status)
return status;
if (v->get_master_key_list == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->get_master_key_list(kcontext, keylist);
}
@@ -1153,7 +1153,7 @@
if (status)
return status;
if (v->store_master_key_list == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->store_master_key_list(kcontext, keyfile, mname, keylist,
master_pwd);
}
@@ -2178,7 +2178,7 @@
if (status)
return status;
if (v->create_policy == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->create_policy(kcontext, policy);
}
@@ -2193,7 +2193,7 @@
if (status)
return status;
if (v->get_policy == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->get_policy(kcontext, name, policy, cnt);
}
@@ -2207,7 +2207,7 @@
if (status)
return status;
if (v->put_policy == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->put_policy(kcontext, policy);
}
@@ -2236,7 +2236,7 @@
if (status)
return status;
if (v->delete_policy == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->delete_policy(kcontext, policy);
}
@@ -2342,6 +2342,6 @@
if (status)
return status;
if (v->invoke == NULL)
- return KRB5_KDB_DBTYPE_NOSUP;
+ return KRB5_PLUGIN_OP_NOTSUPP;
return v->invoke(kcontext, method, req, rep);
}
Modified: trunk/src/plugins/kdb/db2/kdb_ext.c
===================================================================
--- trunk/src/plugins/kdb/db2/kdb_ext.c 2010-07-03 15:23:45 UTC (rev 24169)
+++ trunk/src/plugins/kdb/db2/kdb_ext.c 2010-07-03 19:02:41 UTC (rev 24170)
@@ -80,7 +80,7 @@
const krb5_data *req,
krb5_data *rep)
{
- krb5_error_code code = KRB5_KDB_DBTYPE_NOSUP;
+ krb5_error_code code = KRB5_PLUGIN_OP_NOTSUPP;
switch (method) {
case KRB5_KDB_METHOD_CHECK_POLICY_AS:
Modified: trunk/src/plugins/kdb/ldap/libkdb_ldap/kdb_ext.c
===================================================================
--- trunk/src/plugins/kdb/ldap/libkdb_ldap/kdb_ext.c 2010-07-03 15:23:45 UTC (rev 24169)
+++ trunk/src/plugins/kdb/ldap/libkdb_ldap/kdb_ext.c 2010-07-03 19:02:41 UTC (rev 24170)
@@ -114,7 +114,7 @@
const krb5_data *req,
krb5_data *rep)
{
- krb5_error_code code = KRB5_KDB_DBTYPE_NOSUP;
+ krb5_error_code code = KRB5_PLUGIN_OP_NOTSUPP;
switch (method) {
case KRB5_KDB_METHOD_CHECK_POLICY_AS:
More information about the cvs-krb5
mailing list