X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fbackend.c;h=c8d30afd066efce744304c112c6d58a149fb9c74;hb=48b63d4f165269f29c35f89cceddd880c3966ef5;hp=e7d6c13d4b92973267a981222a0af2f092c10928;hpb=5a470f89594d1d8ca986801376f3b88671fdde20;p=openldap diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index e7d6c13d4b..c8d30afd06 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -13,6 +13,8 @@ #include "slap.h" #include "lutil.h" +#include "ldap_defaults.h" + #ifdef SLAPD_LDAP #include "back-ldap/external.h" #endif @@ -385,6 +387,9 @@ backend_db_init( be->be_sizelimit = defsize; be->be_timelimit = deftime; + be->be_realm = global_realm != NULL + ? ch_strdup( global_realm ) : NULL; + if(bi->bi_db_init) { rc = bi->bi_db_init( be ); } @@ -434,26 +439,6 @@ select_backend( char * dn ) } } - /* if no proper suffix could be found then check for aliases */ - for ( i = 0; i < nbackends; i++ ) { - for ( j = 0; - backends[i].be_suffixAlias != NULL && - backends[i].be_suffixAlias[j] != NULL; - j += 2 ) - { - len = strlen( backends[i].be_suffixAlias[j] ); - - if ( len > dnlen ) { - continue; - } - - if ( strcmp( backends[i].be_suffixAlias[j], - dn + (dnlen - len) ) == 0 ) { - return( &backends[i] ); - } - } - } - #ifdef LDAP_ALLOW_NULL_SEARCH_BASE /* Add greg@greg.rim.or.jp * It's quick hack for cheap client @@ -525,7 +510,7 @@ be_isroot_pw( Backend *be, char *ndn, struct berval *cred ) ldap_pvt_thread_mutex_lock( &crypt_mutex ); #endif - result = lutil_passwd( cred->bv_val, be->be_root_pw ); + result = lutil_passwd( cred->bv_val, be->be_root_pw, NULL ); #ifdef SLAPD_CRYPT ldap_pvt_thread_mutex_unlock( &crypt_mutex ); @@ -596,7 +581,6 @@ backend_connection_destroy( return 0; } -#ifdef SLAPD_ACLGROUPS int backend_group( Backend *be, @@ -613,4 +597,22 @@ backend_group( else return(1); } + +#ifdef SLAPD_SCHEMA_DN +Attribute *backend_subschemasubentry( Backend *be ) +{ + /* should be backend specific */ + static struct berval ss_val = { + sizeof(SLAPD_SCHEMA_DN)-1, + SLAPD_SCHEMA_DN }; + static struct berval *ss_vals[2] = { &ss_val, NULL }; + static Attribute ss_attr = { + "subschemasubentry", + ss_vals, + SYNTAX_DN | SYNTAX_CIS, + NULL + }; + + return &ss_attr; +} #endif