goto fail;
}
+ flags &= ~REP_ENTRY_MUSTRELEASE;
flags |= ( REP_ENTRY_MODIFIABLE | REP_ENTRY_MUSTBEFREED );
}
* to return, and remap them accordingly */
(void)rwm_attrs( op, rs, &e->e_attrs, 1 );
-#if 0
- if ( rs->sr_operational_attrs ) {
- (void)rwm_attrs( op, rs, &rs->sr_operational_attrs, 0 );
+ if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
+ be_entry_release_rw( op, rs->sr_entry, 0 );
}
-#endif
rs->sr_entry = e;
rs->sr_flags = flags;
(struct ldaprwmap *)on->on_bi.bi_private;
#ifdef ENABLE_REWRITE
- if (rwmap->rwm_rw) {
+ if ( rwmap->rwm_rw ) {
rewrite_info_delete( &rwmap->rwm_rw );
}
#else /* !ENABLE_REWRITE */
}
#endif /* !ENABLE_REWRITE */
- avl_free( rwmap->rwm_oc.remap, NULL );
+ avl_free( rwmap->rwm_oc.remap, rwm_mapping_dst_free );
avl_free( rwmap->rwm_oc.map, rwm_mapping_free );
- avl_free( rwmap->rwm_at.remap, NULL );
+ avl_free( rwmap->rwm_at.remap, rwm_mapping_dst_free );
avl_free( rwmap->rwm_at.map, rwm_mapping_free );
ch_free( rwmap );
if ( mapping[0].m_dst_oc == NULL ) {
fprintf( stderr, "%s: line %d: unable to mimic destination objectClass '%s'\n",
fname, lineno, dst );
- return 1;
+ goto error_return;
}
#if 0
fprintf( stderr,
"%s: line %d: source attributeType '%s': %d (%s)\n",
fname, lineno, src, rc, text ? text : "null" );
- return 1;
+ goto error_return;
}
}
fprintf( stderr,
"%s: line %d: destination attributeType '%s': %d (%s)\n",
fname, lineno, dst, rc, text ? text : "null" );
- return 1;
+ goto error_return;
}
}
mapping[1].m_src_ad = mapping[0].m_dst_ad;
return 0;
}
+void
+rwm_mapping_dst_free( void *v_mapping )
+{
+ struct ldapmapping *mapping = v_mapping;
+
+ if ( BER_BVISEMPTY( &mapping[0].m_dst ) ) {
+ rwm_mapping_free( &mapping[ -1 ] );
+ }
+}
+
void
rwm_mapping_free( void *v_mapping )
{