- for ( j = 0; !BER_BVISNULL( &ml->sml_values[ j ] ); j++ ) {
- ldap_back_map( &li->targets[ candidate ]->mt_rwmap.rwm_oc,
- &ml->sml_values[ j ],
- &mapped, BACKLDAP_MAP );
- if ( BER_BVISNULL( &mapped ) || BER_BVISEMPTY( &mapped ) )
- {
- continue;
+ for ( j = 0; !BER_BVISNULL( &ml->sml_values[ j ] ); ) {
+ struct ldapmapping *mapping;
+
+ ldap_back_mapping( &mi->mi_targets[ candidate ].mt_rwmap.rwm_oc,
+ &ml->sml_values[ j ], &mapping, BACKLDAP_MAP );
+
+ if ( mapping == NULL ) {
+ if ( mi->mi_targets[ candidate ].mt_rwmap.rwm_oc.drop_missing ) {
+ continue;
+ }
+ mods[ i ].mod_bvalues[ j ] = &ml->sml_values[ j ];
+
+ } else {
+ mods[ i ].mod_bvalues[ j ] = &mapping->dst;