+ return;
+ }
+#endif
+
+ fprintf( fp, "time: %ld\n", now );
+ fprintf( fp, "dn: %s\n", dn->bv_val );
+
+ replog1( NULL, op, change, fp, NULL );
+
+ if ( subsets > 0 ) {
+ void *first;
+ for ( i = subsets - 1; be->be_replica != NULL && be->be_replica[i] != NULL; i++ ) {
+
+ /* If no attrs, we already did this above */
+ if ( be->be_replica[i]->ri_attrs == NULL ) {
+ continue;
+ }
+
+ /* check if dn's suffix matches legal suffixes, if any */
+ if ( be->be_replica[i]->ri_nsuffix != NULL ) {
+ int j;
+
+ for ( j = 0; be->be_replica[i]->ri_nsuffix[j].bv_val; j++ ) {
+ if ( dnIsSuffix( ndn, &be->be_replica[i]->ri_nsuffix[j] ) ) {
+ break;
+ }
+ }
+
+ if ( !be->be_replica[i]->ri_nsuffix[j].bv_val ) {
+ /* do not add "replica:" line */
+ continue;
+ }
+ }
+ subsets = 0;
+ first = NULL;
+ switch( op->o_tag ) {
+ case LDAP_REQ_EXTENDED:
+ /* quick hack for extended operations */
+ /* assume change parameter is a Modfications* */
+ /* fall thru */
+ case LDAP_REQ_MODIFY:
+ for ( ml = change; ml != NULL; ml = ml->sml_next ) {
+ int is_in, exclude;
+
+ is_in = ad_inlist( ml->sml_desc, be->be_replica[i]->ri_attrs );
+ exclude = be->be_replica[i]->ri_exclude;
+
+ /*
+ * there might be a more clever way to do this test,
+ * but this way, at least, is comprehensible :)
+ */
+ if ( ( is_in && !exclude ) || ( !is_in && exclude ) ) {
+ subsets = 1;
+ first = ml;
+ break;
+ }
+ }
+ if ( !subsets ) {
+ continue;
+ }