X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Frepl.c;h=9cf8c1cac165cd3c9cff5f647c9fc7707516b8a2;hb=9c550e7235830af9d031d8d7ba86b87f36dcc99f;hp=c4029df92517e5dabd469fed594f08a817f59e5a;hpb=c3bb9e42a68f99457d3fbdfc3af651fedfd99609;p=openldap diff --git a/servers/slapd/repl.c b/servers/slapd/repl.c index c4029df925..9cf8c1cac1 100644 --- a/servers/slapd/repl.c +++ b/servers/slapd/repl.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2003 The OpenLDAP Foundation. + * Copyright 1998-2004 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -134,14 +134,16 @@ replog( Operation *op ) #endif int subsets = 0; long now = slap_get_time(); + char *replogfile; - if ( op->o_bd->be_replogfile == NULL && replogfile == NULL ) { + replogfile = op->o_bd->be_replogfile ? op->o_bd->be_replogfile : + frontendDB->be_replogfile; + if ( !replogfile ) { return; } ldap_pvt_thread_mutex_lock( &replog_mutex ); - if ( (fp = lock_fopen( op->o_bd->be_replogfile ? op->o_bd->be_replogfile : - replogfile, "a", &lfp )) == NULL ) { + if ( (fp = lock_fopen( replogfile, "a", &lfp )) == NULL ) { ldap_pvt_thread_mutex_unlock( &replog_mutex ); return; } @@ -300,20 +302,22 @@ replog1( * in any subset, otherwise drop it. */ if ( ocs && ml->sml_desc == slap_schema.si_ad_objectClass - && ml->sml_bvalues ) { + && ml->sml_values ) + { int i, first = 1; if ( ocs == -1 ) ocs = 0; - for ( i=0; ml->sml_bvalues[i].bv_val; i++ ) { + for ( i=0; ml->sml_values[i].bv_val; i++ ) { int match = 0; for ( an = ri->ri_attrs; an->an_name.bv_val; an++ ) { if ( an->an_oc ) { ocs = 1; - if ( ml->sml_bvalues[i].bv_len == an->an_name.bv_len - && !strcasecmp(ml->sml_bvalues[i].bv_val, + match |= an->an_oc_exclude; + if ( ml->sml_values[i].bv_len == an->an_name.bv_len + && !strcasecmp(ml->sml_values[i].bv_val, an->an_name.bv_val ) ) { - match = 1 ^ an->an_oc_exclude; + match = !an->an_oc_exclude; break; } } @@ -356,8 +360,8 @@ replog1( dohdr = 0; } fprintf( fp, "%s: %s\n", did, type ); - if ( ml->sml_bvalues ) { - print_vals( fp, &ml->sml_desc->ad_cname, ml->sml_bvalues ); + if ( ml->sml_values ) { + print_vals( fp, &ml->sml_desc->ad_cname, ml->sml_values ); } fprintf( fp, "-\n" ); } @@ -385,10 +389,11 @@ replog1( for ( an = ri->ri_attrs; an->an_name.bv_val; an++ ) { if ( an->an_oc ) { ocs = 1; + match |= an->an_oc_exclude; if ( a->a_vals[i].bv_len == an->an_name.bv_len && !strcasecmp(a->a_vals[i].bv_val, an->an_name.bv_val ) ) { - match = 1 ^ an->an_oc_exclude; + match = !an->an_oc_exclude; break; } }