summaryrefslogtreecommitdiffstats
path: root/src/include/kdb.h
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2010-07-02 03:23:21 +0000
committerGreg Hudson <ghudson@mit.edu>2010-07-02 03:23:21 +0000
commit41c912b326a4b88b548a6897fd9efe11f71ebfad (patch)
tree29bb0a6b9be1484ea28c556067215bae747bd5ba /src/include/kdb.h
parent3ecdc07603dfa6acc4604abfc5c2e0274204746d (diff)
downloadkrb5-41c912b326a4b88b548a6897fd9efe11f71ebfad.tar.gz
krb5-41c912b326a4b88b548a6897fd9efe11f71ebfad.tar.xz
krb5-41c912b326a4b88b548a6897fd9efe11f71ebfad.zip
DAL improvements
Add KRB5_KDB_API_VERSION to allow callers to adjust to incompatible changes in libkdb; to be kept in sync with the libkdb major version, which is bumped to 5 in anticipation of other changes. Add KRB5_KDB_DAL_VERSION to allow database modules to detect when they are mismatched with the KDB version. Since KDB modules are often developed concurrently with trunk code, this is defined to be the date of the last incompatible DAL change. The DAL version is passed to the init_library DAL function; the module should check it against the value of KRB5_KDB_DAL_VERSION it was compiled with and return KRB5_KDB_DBTYPE_MISMATCH if it doesn't match. ticket: 6749 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24157 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include/kdb.h')
-rw-r--r--src/include/kdb.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/include/kdb.h b/src/include/kdb.h
index 5225a12e52..6248725a60 100644
--- a/src/include/kdb.h
+++ b/src/include/kdb.h
@@ -72,6 +72,10 @@
#include <krb5.h>
+/* This version will be incremented when incompatible changes are made to the
+ * KDB API, and will be kept in sync with the libkdb major version. */
+#define KRB5_KDB_API_VERSION 5
+
/* Salt types */
#define KRB5_KDB_SALTTYPE_NORMAL 0
#define KRB5_KDB_SALTTYPE_V4 1
@@ -860,6 +864,13 @@ krb5_dbe_free_tl_data(krb5_context, krb5_tl_data *);
#define KRB5_KDB_OPT_SET_LOCK_MODE 1
/*
+ * This number indicates the date of the last incompatible change to the
+ * DAL. It is passed to init_library to allow KDB modules to detect when
+ * they are being loaded by an incompatible version of the KDC.
+ */
+#define KRB5_KDB_DAL_VERSION 20100701
+
+/*
* A krb5_context can hold one database object. Modules should use
* context->dal_handle->db_context to store state associated with the database
* object.
@@ -886,7 +897,7 @@ typedef struct _kdb_vftabl {
* Mandatory: Invoked after the module library is loaded, when the first DB
* using the module is opened, across all contexts.
*/
- krb5_error_code (*init_library)(void);
+ krb5_error_code (*init_library)(int dal_version);
/*
* Mandatory: Invoked before the module library is unloaded, after the last