From 22f05c67851ed9787ab330631facf9ad67bce7cc Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 28 Nov 2005 14:13:54 +0000 Subject: [PATCH] add support for backend/overlay obsolete names... --- servers/slapd/backover.c | 19 ++++++++++++++++++- servers/slapd/overlays/pcache.c | 6 ++++++ servers/slapd/slap.h | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index b87500ebc2..1a2aa3e0e5 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -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; } diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 61e80fe022..c2998332fb 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -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; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 4379a6dadc..5f58a6f7c2 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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 ; }; -- 2.39.5