Skip to content
Snippets Groups Projects
Commit 486ad592 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add a DB version check.

parent cda7d4b2
No related branches found
No related tags found
No related merge requests found
...@@ -106,6 +106,29 @@ int ldbm_initialize( const char* home ) ...@@ -106,6 +106,29 @@ int ldbm_initialize( const char* home )
if(ldbm_initialized++) return 1; if(ldbm_initialized++) return 1;
{
char *version;
int major, minor, patch;
version = db_version( &major, &minor, &patch );
if( major != DB_VERSION_MAJOR ||
minor >= DB_VERSION_MINOR )
{
#ifdef LDAP_SYSLOG
char error[BUFSIZ];
sprintf( error, "%s (%d)\n", STRERROR( err ), err );
syslog( LOG_INFO,
"ldbm_initialize(): versoin mismatch\nexpected: %s\ngot: %s\n",
DB_VERSION_STRING,
version );
#endif
return 1;
}
}
#ifndef HAVE_BERKELEY_DB_THREAD #ifndef HAVE_BERKELEY_DB_THREAD
ldap_pvt_thread_mutex_init( &ldbm_big_mutex ); ldap_pvt_thread_mutex_init( &ldbm_big_mutex );
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment