mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Add a DB version check.
This commit is contained in:
parent
cda7d4b2fc
commit
486ad59260
@ -106,6 +106,29 @@ int ldbm_initialize( const char* home )
|
||||
|
||||
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
|
||||
ldap_pvt_thread_mutex_init( &ldbm_big_mutex );
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user