diff options
author | Greg Hudson <ghudson@mit.edu> | 2010-07-02 03:23:21 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2010-07-02 03:23:21 +0000 |
commit | 41c912b326a4b88b548a6897fd9efe11f71ebfad (patch) | |
tree | 29bb0a6b9be1484ea28c556067215bae747bd5ba /src/lib/kdb | |
parent | 3ecdc07603dfa6acc4604abfc5c2e0274204746d (diff) | |
download | krb5-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/lib/kdb')
-rw-r--r-- | src/lib/kdb/Makefile.in | 3 | ||||
-rw-r--r-- | src/lib/kdb/kdb5.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/kdb/Makefile.in b/src/lib/kdb/Makefile.in index c450a98193..3781dfb9ac 100644 --- a/src/lib/kdb/Makefile.in +++ b/src/lib/kdb/Makefile.in @@ -8,8 +8,9 @@ CFLAGS=@CFLAGS@ -DKDB5_USE_LIB_KDB_DB2 LOCALINCLUDES= -I. DEFS= +# Keep LIBMAJOR in sync with KRB5_KDB_API_VERSION in include/kdb.h. LIBBASE=kdb5 -LIBMAJOR=4 +LIBMAJOR=5 LIBMINOR=0 LIBINITFUNC=kdb_init_lock_list LIBFINIFUNC=kdb_fini_lock_list diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index a7e1bb5c1f..c4c7ec6dc1 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -311,7 +311,7 @@ kdb_load_library(krb5_context kcontext, char *lib_name, db_library *libptr) memcpy(&lib->vftabl, vftabl_addr, sizeof(kdb_vftabl)); kdb_setup_opt_functions(lib); - status = lib->vftabl.init_library(); + status = lib->vftabl.init_library(KRB5_KDB_DAL_VERSION); if (status) goto cleanup; @@ -408,7 +408,7 @@ kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib) memcpy(&(*lib)->vftabl, vftabl_addrs[0], sizeof(kdb_vftabl)); kdb_setup_opt_functions(*lib); - if ((status = (*lib)->vftabl.init_library())) + if ((status = (*lib)->vftabl.init_library(KRB5_KDB_DAL_VERSION))) goto clean_n_exit; clean_n_exit: |