summaryrefslogtreecommitdiffstats
path: root/src/plugins
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/plugins
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/plugins')
-rw-r--r--src/plugins/kdb/db2/db2_exp.c5
-rw-r--r--src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h2
-rw-r--r--src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c5
3 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/kdb/db2/db2_exp.c b/src/plugins/kdb/db2/db2_exp.c
index c7fb7566a0..73aa6394f0 100644
--- a/src/plugins/kdb/db2/db2_exp.c
+++ b/src/plugins/kdb/db2/db2_exp.c
@@ -201,9 +201,12 @@ WRAP_K (krb5_db2_invoke,
(kcontext, method, request, response));
static krb5_error_code
-hack_init ()
+hack_init (int dal_version)
{
krb5_error_code c;
+
+ if (dal_version != KRB5_KDB_DAL_VERSION)
+ return KRB5_KDB_DBTYPE_MISMATCH;
c = krb5int_mutex_alloc (&krb5_db2_mutex);
if (c)
return c;
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h
index 95909f6beb..0f7921074c 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h
+++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h
@@ -254,7 +254,7 @@ krb5_error_code
krb5_ldap_db_get_age(krb5_context, char *, time_t *);
krb5_error_code
-krb5_ldap_lib_init(void);
+krb5_ldap_lib_init(int dal_version);
krb5_error_code
krb5_ldap_lib_cleanup(void);
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c
index 82b0333cdd..8ebe73abdc 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c
+++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c
@@ -312,9 +312,10 @@ krb5_ldap_rebind(krb5_ldap_context *ldap_context,
* DAL API functions
*/
krb5_error_code
-krb5_ldap_lib_init()
+krb5_ldap_lib_init(int dal_version)
{
- return 0;
+ if (dal_version != KRB5_KDB_DAL_VERSION)
+ return KRB5_KDB_DBTYPE_MISMATCH;
}
krb5_error_code