mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
update CDB support
This commit is contained in:
parent
ca8185c296
commit
3e37daca66
10
CHANGES
10
CHANGES
@ -1,19 +1,19 @@
|
||||
OpenLDAP 2.0 Change Log
|
||||
|
||||
OpenLDAP 2.0.12 Engineering
|
||||
Fixed ldapmodrdn SASL auth bug (ITS#1179)
|
||||
Fixed slapd modlist2mods error text bug
|
||||
Fixed slapd empty rootdn bug (ITS#1172)
|
||||
Fixed slapd numericString empty value bug (ITS#1182)
|
||||
Fixed slapd undefined attr error report
|
||||
Fixed slapd acl default clause bug (ITS#1187)
|
||||
Fixed ldapmodrdn SASL auth bug (ITS#1179)
|
||||
Added slapd DB_ENV support
|
||||
Added slapadd already exists check (ITS#1191)
|
||||
Added slapd modrdn children check (ITS#1053,1192)
|
||||
Added slapd sb_max_incoming_auth support (ITS#1181)
|
||||
Added slapadd already exists check (ITS#1191)
|
||||
Added slapd DB_ENV support
|
||||
Updated slapd schema check handling
|
||||
Updated ldbm to use BerkeleyDB's CDB (ITS#1176)
|
||||
Updated slapd filter checks
|
||||
Updated ldaptcl API (contrib)
|
||||
Updated ldbm to use BerkeleyDB's CDB (ITS#1176)
|
||||
Build environment
|
||||
Remove extraneous files
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
Berkeley DB version 2.x and OpenLDAP running threads
|
||||
====================================================
|
||||
|
||||
Special care has to be taken when building Berkeley DB 2.x
|
||||
for use with OpenLDAP as an slapd backend. If OpenLDAP is used
|
||||
with threads, so must Berkeley DB. If OpenLDAP is built without
|
||||
threads, so must Berkeley DB. In general, you should use
|
||||
the latest Sleepycat version.
|
||||
|
||||
The configuration tool of Sleepycat's Berkeley DB will automatically
|
||||
set appropriate options on IRIX, OSF/1, and SUN Solaris platforms
|
||||
(version 2.3.16), as well as FreeBSD (version 2.7.5). The options
|
||||
must be manually defined on other plaforms, e.g. on LINUX.
|
||||
|
||||
On PC-LINUX (kernel version 2.0.35, linux kernel threads as imple-
|
||||
mented by libpthreads.so.1.60.4) with gcc as the standard compiler
|
||||
the environment variable CPPFLAGS must define -D_REENTRANT, while
|
||||
building the Berkeley DB package.
|
||||
|
||||
DO NOT USE THE -ansi CFLAG, SINCE THEN THE DB PACKAGE'S CONFIGURE
|
||||
CANNOT FIND THE X86/GCC SPINLOCKS, WHICH ARE NEEDED FOR THREAD-
|
||||
SUPPORT WITH THE BERKELEY DB.
|
||||
|
||||
Please check carefully if your platform is not mentioned above.
|
||||
|
||||
The OpenLDAP configure tool will most probably find the correct
|
||||
configuration itself. No special action has to be taken
|
||||
while building the OpenLDAP package.
|
||||
|
@ -265,6 +265,24 @@ AC_DEFUN([OL_BERKELEY_DB_TRY],
|
||||
#define NULL ((void*)0)
|
||||
#endif
|
||||
],[
|
||||
#if DB_VERSION_MAJOR > 1
|
||||
{
|
||||
char *version;
|
||||
int major, minor, patch;
|
||||
|
||||
version = db_version( &major, &minor, &patch );
|
||||
|
||||
if( major != DB_VERSION_MAJOR ||
|
||||
minor < DB_VERSION_MINOR )
|
||||
{
|
||||
printf("Berkeley DB version mismatch\n"
|
||||
"\texpected: %s\n\tgot: %s\n",
|
||||
DB_VERSION_STRING, version);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if DB_VERSION_MAJOR > 2
|
||||
db_env_create( NULL, 0 );
|
||||
#elif DB_VERSION_MAJOR > 1
|
||||
@ -329,11 +347,18 @@ main()
|
||||
|
||||
rc = db_env_create( &env, 0 );
|
||||
|
||||
if( rc ) return rc;
|
||||
if( rc ) {
|
||||
printf("BerkeleyDB: %s\n", db_strerror(rc) );
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifdef DB_CDB_ALLDB
|
||||
rc = env->set_flags( env, DB_CDB_ALLDB, 1 );
|
||||
if( rc ) goto done;
|
||||
|
||||
if( rc ) {
|
||||
printf("BerkeleyDB: %s\n", db_strerror(rc) );
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
|
||||
@ -342,14 +367,14 @@ main()
|
||||
rc = env->open( env, NULL, NULL, flags, 0 );
|
||||
#endif
|
||||
|
||||
#ifdef DB_CDB_ALLDB
|
||||
done:
|
||||
#endif
|
||||
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
|
||||
env->remove( env, NULL, DB_FORCE);
|
||||
#else
|
||||
env->remove( env, NULL, NULL, DB_FORCE);
|
||||
#endif
|
||||
if ( rc == 0 ) {
|
||||
rc = env->close( env, 0 );
|
||||
}
|
||||
|
||||
if( rc ) {
|
||||
printf("BerkeleyDB: %s\n", db_strerror(rc) );
|
||||
return rc;
|
||||
}
|
||||
|
||||
#else
|
||||
DB_ENV env;
|
||||
|
@ -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(): version 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
|
||||
@ -252,6 +275,8 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
|
||||
err = db_create( &ret, ldbm_Env, 0 );
|
||||
if ( err != 0 ) {
|
||||
(void)ret->close(ret, 0);
|
||||
LDBM_UNLOCK;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -260,12 +285,16 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
|
||||
|
||||
err = ret->open( ret, name, NULL, DB_TYPE, rw, mode);
|
||||
|
||||
LDBM_UNLOCK;
|
||||
|
||||
if ( err != 0 ) {
|
||||
int tmp = errno;
|
||||
(void)ret->close(ret, 0);
|
||||
errno = tmp;
|
||||
|
||||
LDBM_UNLOCK;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LDBM_UNLOCK;
|
||||
|
||||
#elif DB_VERSION_MAJOR >= 2
|
||||
DB_INFO dbinfo;
|
||||
@ -313,7 +342,7 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
|
||||
LDBM_UNLOCK;
|
||||
#endif
|
||||
|
||||
return( ret );
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -8,6 +8,6 @@ To modify the debug level the tests run slapd with, set the SLAPD_DEBUG
|
||||
environment variable.
|
||||
env SLAPD_DEBUG=1 make test
|
||||
|
||||
To test LDAPv3, set PROTO to "-P 3".
|
||||
env PROTO="-P 3" make test
|
||||
To test LDAPv2, set PROTO to "-P 2".
|
||||
env PROTO="-P 2" make test
|
||||
|
||||
|
@ -14,7 +14,7 @@ argsfile ./test-db/slapd.args
|
||||
#######################################################################
|
||||
|
||||
backend ldbm
|
||||
directory ./test-db
|
||||
# directory ./test-db
|
||||
|
||||
database ldbm
|
||||
|
||||
|
@ -14,7 +14,7 @@ argsfile ./test-db/slapd.args
|
||||
#######################################################################
|
||||
|
||||
backend ldbm
|
||||
directory ./test-db
|
||||
# directory ./test-db
|
||||
|
||||
database ldbm
|
||||
|
||||
|
@ -16,7 +16,7 @@ argsfile ./test-db/slapd.args
|
||||
#######################################################################
|
||||
|
||||
backend ldbm
|
||||
directory ./test-db
|
||||
# directory ./test-db
|
||||
|
||||
database ldbm
|
||||
cachesize 0
|
||||
|
@ -18,7 +18,7 @@ argsfile ./test-repl/slapd.args
|
||||
referral "ldap://localhost:9009/"
|
||||
|
||||
backend ldbm
|
||||
directory ./test-repl
|
||||
# directory ./test-repl
|
||||
|
||||
database ldbm
|
||||
|
||||
|
@ -16,7 +16,7 @@ argsfile ./test-db/slapd.args
|
||||
#######################################################################
|
||||
|
||||
backend ldbm
|
||||
directory ./test-db
|
||||
# directory ./test-db
|
||||
|
||||
database ldbm
|
||||
cachesize 0
|
||||
|
@ -17,7 +17,7 @@ argsfile ./test-repl/slapd.args
|
||||
#######################################################################
|
||||
|
||||
backend ldbm
|
||||
directory ./test-repl
|
||||
# directory ./test-repl
|
||||
|
||||
database ldbm
|
||||
cachesize 0
|
||||
|
@ -24,7 +24,7 @@ argsfile ./test-db/slapd.args
|
||||
#######################################################################
|
||||
|
||||
backend ldbm
|
||||
directory ./test-db
|
||||
# directory ./test-db
|
||||
|
||||
database ldbm
|
||||
suffix "o=OpenLDAP Project, l=Internet"
|
||||
|
@ -16,7 +16,7 @@ argsfile ./test-db/slapd.args
|
||||
#######################################################################
|
||||
|
||||
backend ldbm
|
||||
directory ./test-db
|
||||
# directory ./test-db
|
||||
|
||||
database ldbm
|
||||
suffix "o=University of Michigan, c=US"
|
||||
|
Loading…
Reference in New Issue
Block a user