add support for backend/overlay obsolete names...

This commit is contained in:
Pierangelo Masarati 2005-11-28 14:13:54 +00:00
parent 26d802ee53
commit 22f05c6785
3 changed files with 25 additions and 1 deletions

View File

@ -754,10 +754,27 @@ overlay_find( const char *over_type )
for ( ; on; on = on->on_next ) {
if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
break;
goto foundit;
}
if ( on->on_bi.bi_obsolete_names != NULL ) {
int i;
for ( i = 0; on->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
if ( strcmp( on->on_bi.bi_obsolete_names[ i ], over_type ) == 0 ) {
Debug( LDAP_DEBUG_ANY,
"overlay_find(\"%s\"): "
"obsolete name for \"%s\".\n",
on->on_bi.bi_obsolete_names[ i ],
on->on_bi.bi_type, 0 );
goto foundit;
}
}
}
}
foundit:;
return on;
}

View File

@ -2196,6 +2196,11 @@ pcache_db_destroy(
static slap_overinst pcache;
static char *obsolete_names[] = {
"proxycache",
NULL
};
int pcache_initialize()
{
LDAPAttributeType *at;
@ -2223,6 +2228,7 @@ int pcache_initialize()
}
pcache.on_bi.bi_type = "pcache";
pcache.on_bi.bi_obsolete_names = obsolete_names;
pcache.on_bi.bi_db_init = pcache_db_init;
pcache.on_bi.bi_db_config = pcache_db_config;
pcache.on_bi.bi_db_open = pcache_db_open;

View File

@ -2184,6 +2184,7 @@ struct slap_backend_info {
unsigned int bi_nDB; /* number of databases of this type */
struct ConfigOCs *bi_cf_ocs;
char **bi_obsolete_names;
void *bi_private; /* anything the backend type needs */
LDAP_STAILQ_ENTRY(slap_backend_info) bi_next ;
};