-#ifdef OL_2_2_COMPAT
-static int
-dynlist_db_config(
- BackendDB *be,
- const char *fname,
- int lineno,
- int argc,
- char **argv )
-{
- slap_overinst *on = (slap_overinst *)be->bd_info;
-
- int rc = 0;
-
- if ( strcasecmp( argv[0], "dynlist-attrset" ) == 0 ) {
- dynlist_info_t **dlip;
- ObjectClass *oc;
- AttributeDescription *ad = NULL,
- *member_ad = NULL;
- const char *text;
-
- if ( argc < 3 || argc > 4 ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
- "invalid arg number #%d.\n",
- fname, lineno, argc );
- return 1;
- }
-
- oc = oc_find( argv[1] );
- if ( oc == NULL ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
- "unable to find ObjectClass \"%s\"\n",
- fname, lineno, argv[ 1 ] );
- return 1;
- }
-
- rc = slap_str2ad( argv[2], &ad, &text );
- if ( rc != LDAP_SUCCESS ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
- "unable to find AttributeDescription \"%s\"\n",
- fname, lineno, argv[2] );
- return 1;
- }
-
- if ( !is_at_subtype( ad->ad_type, slap_schema.si_ad_labeledURI->ad_type ) ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
- "AttributeDescription \"%s\" "
- "must be a subtype of \"labeledURI\"\n",
- fname, lineno, argv[2] );
- return 1;
- }
-
- if ( argc == 4 ) {
- rc = slap_str2ad( argv[3], &member_ad, &text );
- if ( rc != LDAP_SUCCESS ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
- "unable to find AttributeDescription \"%s\"\n",
- fname, lineno, argv[3] );
- return 1;
- }
- }
-
- for ( dlip = (dynlist_info_t **)&on->on_bi.bi_private;
- *dlip; dlip = &(*dlip)->dli_next )
- {
- /* The check on objectClass may be relaxed */
-#if 0
- if ( (*dlip)->dli_oc == oc ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
- "objectClass \"%s\" already mapped.\n",
- fname, lineno, oc->soc_cname.bv_val );
- return 1;
- }
-#endif
-
- if ( (*dlip)->dli_ad == ad ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
- "URL attributeDescription \"%s\" already mapped.\n",
- fname, lineno, ad->ad_cname.bv_val );
- return 1;
- }
-
- if ( member_ad != NULL && (*dlip)->dli_member_ad == member_ad ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrset <oc> <URL-ad> [<member-ad>]\": "
- "member attributeDescription \"%s\" already mapped.\n",
- fname, lineno, member_ad->ad_cname.bv_val );
- return 1;
- }
- }
-
- *dlip = (dynlist_info_t *)ch_calloc( 1, sizeof( dynlist_info_t ) );
- (*dlip)->dli_oc = oc;
- (*dlip)->dli_ad = ad;
- (*dlip)->dli_member_ad = member_ad;
-
- if ( dynlist_build_def_filter( *dlip ) ) {
- ch_free( *dlip );
- *dlip = NULL;
- return 1;
- }
-
- /* allow dyngroup syntax */
- } else if ( strcasecmp( argv[0], "dynlist-attrpair" ) == 0 ) {
- dynlist_info_t **dlip;
- ObjectClass *oc;
- AttributeDescription *ad = NULL,
- *member_ad = NULL;
- const char *text;
-
- if ( argc != 3 ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrpair <member-ad> <URL-ad>\": "
- "invalid arg number #%d.\n",
- fname, lineno, argc );
- return 1;
- }
-
- oc = oc_find( "groupOfURLs" );
- if ( oc == NULL ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrpair <member-ad> <URL-ad>\": "
- "unable to find default ObjectClass \"groupOfURLs\"\n",
- fname, lineno, 0 );
- return 1;
- }
-
- rc = slap_str2ad( argv[1], &member_ad, &text );
- if ( rc != LDAP_SUCCESS ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrpair <member-ad> <URL-ad>\": "
- "unable to find AttributeDescription \"%s\"\n",
- fname, lineno, argv[1] );
- return 1;
- }
-
- rc = slap_str2ad( argv[2], &ad, &text );
- if ( rc != LDAP_SUCCESS ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrpair <member-ad> <URL-ad>\": "
- "unable to find AttributeDescription \"%s\"\n",
- fname, lineno, argv[2] );
- return 1;
- }
-
- if ( !is_at_subtype( ad->ad_type, slap_schema.si_ad_labeledURI->ad_type ) ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrpair <member-ad> <URL-ad>\": "
- "AttributeDescription \"%s\" "
- "must be a subtype of \"labeledURI\"\n",
- fname, lineno, argv[2] );
- return 1;
- }
-
-
- for ( dlip = (dynlist_info_t **)&on->on_bi.bi_private;
- *dlip; dlip = &(*dlip)->dli_next )
- {
-#if 0
- /* The check on objectClass may be relaxed */
- if ( (*dlip)->dli_oc == oc ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrpair <member-ad> <URL-ad>\": "
- "objectClass \"%s\" already mapped.\n",
- fname, lineno, oc->soc_cname.bv_val );
- return 1;
- }
-#endif
-
- if ( (*dlip)->dli_ad == ad ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrpair <member-ad> <URL-ad>\": "
- "URL attributeDescription \"%s\" already mapped.\n",
- fname, lineno, ad->ad_cname.bv_val );
- return 1;
- }
-
- if ( member_ad != NULL && (*dlip)->dli_member_ad == member_ad ) {
- Debug( LDAP_DEBUG_ANY, "%s: line %d: "
- "\"dynlist-attrpair <member-ad> <URL-ad>\": "
- "member attributeDescription \"%s\" already mapped.\n",
- fname, lineno, member_ad->ad_cname.bv_val );
- return 1;
- }
- }
-
- *dlip = (dynlist_info_t *)ch_calloc( 1, sizeof( dynlist_info_t ) );
- (*dlip)->dli_oc = oc;
- (*dlip)->dli_ad = ad;
- (*dlip)->dli_member_ad = member_ad;
-
- if ( dynlist_build_def_filter( *dlip ) ) {
- ch_free( *dlip );
- *dlip = NULL;
- return 1;
- }
-
- } else {
- rc = SLAP_CONF_UNKNOWN;
- }
-
- return rc;
-}
-
-#else