- if ( strcasecmp( argv[ 1 ], "objectClass" ) == 0 ) {
- map = &li->targets[ i ]->oc_map;
- } else if ( strcasecmp( argv[ 1 ], "attribute" ) == 0 ) {
- map = &li->targets[ i ]->at_map;
- } else {
- fprintf( stderr,
- "%s: line %d: syntax is \"map {objectclass | attribute} [<local> | *] {<foreign> | *}\"\n",
- fname, lineno );
- return 1;
- }
-
- if ( strcmp( argv[ 2 ], "*" ) == 0 ) {
- if ( argc < 4 || strcmp( argv[ 3 ], "*" ) == 0 ) {
- map->drop_missing = ( argc < 4 );
- return 0;
- }
- src = dst = argv[ 3 ];
- } else if ( argc < 4 ) {
- src = "";
- dst = argv[ 2 ];
- } else {
- src = argv[ 2 ];
- dst = ( strcmp( argv[ 3 ], "*" ) == 0 ? src : argv[ 3 ] );
- }
-
- if ( ( map == &li->targets[ i ]->at_map )
- && ( strcasecmp( src, "objectclass" ) == 0
- || strcasecmp( dst, "objectclass" ) == 0 ) ) {
- fprintf( stderr,
- "%s: line %d: objectclass attribute cannot be mapped\n",
- fname, lineno );
- }
-
- mapping = ch_calloc( 2, sizeof( struct ldapmapping ) );
- if ( mapping == NULL ) {
- fprintf( stderr,
- "%s: line %d: out of memory\n",
- fname, lineno );
- return 1;
- }
- ber_str2bv( src, 0, 1, &mapping->src );
- ber_str2bv( dst, 0, 1, &mapping->dst );
- mapping[ 1 ].src = mapping->dst;
- mapping[ 1 ].dst = mapping->src;
-
- if ( (*src != '\0' &&
- avl_find( map->map, ( caddr_t )mapping,
- mapping_cmp ) != NULL)
- || avl_find( map->remap, ( caddr_t )&mapping[ 1 ],
- mapping_cmp ) != NULL) {
- fprintf( stderr,
- "%s: line %d: duplicate mapping found (ignored)\n",
- fname, lineno );
+ return ldap_back_map_config( &li->targets[ i ]->rwmap.rwm_oc,
+ &li->targets[ i ]->rwmap.rwm_at,
+ fname, lineno, argc, argv );
+ /* anything else */
+ } else {
+ if ( meta_back_cache_config( be, fname, lineno, argc, argv ) == 0 ) {