]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
add support for backend/overlay obsolete names...
authorPierangelo Masarati <ando@openldap.org>
Mon, 28 Nov 2005 14:13:54 +0000 (14:13 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 28 Nov 2005 14:13:54 +0000 (14:13 +0000)
servers/slapd/backover.c
servers/slapd/overlays/pcache.c
servers/slapd/slap.h

index b87500ebc2fbb20c085409c11a6cdcc9bb3573e8..1a2aa3e0e5a63ec6e453f08fe6e637bfe14f7977 100644 (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;
 }
 
index 61e80fe0229633d12bfe1a3fc0615e85ae0ba32a..c2998332fb8f43863fb41621f523f249ab50703a 100644 (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;
index 4379a6dadc167870b1b707c26e2cb50da200ba4c..5f58a6f7c231f3b64b980adcc3ee0c574be92a21 100644 (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 ;
 };