Have replog() use struct berval DNs

This commit is contained in:
Kurt Zeilenga 2001-12-25 04:09:09 +00:00
parent c3323c31d5
commit e08a10b853
6 changed files with 22 additions and 18 deletions

View file

@ -318,7 +318,7 @@ do_add( Connection *conn, Operation *op )
if ( !repl_user )
#endif
{
replog( be, op, e->e_dn, e->e_ndn, e );
replog( be, op, &e->e_name, &e->e_nname, e );
}
be_entry_release_w( be, conn, op, e );
e = NULL;

View file

@ -189,7 +189,7 @@ do_delete(
if ( !be->be_update_ndn.bv_len || !repl_user )
#endif
{
replog( be, op, pdn->bv_val, ndn->bv_val, NULL );
replog( be, op, pdn, ndn, NULL );
}
}
#ifndef SLAPD_MULTIMASTER

View file

@ -382,7 +382,7 @@ do_modify(
#endif
) {
/* but we log only the ones not from a replicator user */
replog( be, op, pdn->bv_val, ndn->bv_val, mods );
replog( be, op, pdn, ndn, mods );
}
#ifndef SLAPD_MULTIMASTER

View file

@ -385,7 +385,8 @@ do_modrdn(
#endif
{
if ( (*be->be_modrdn)( be, conn, op, pdn->bv_val, ndn->bv_val,
pnewrdn->bv_val, deloldrdn, pnewSuperior ? pnewSuperior->bv_val : NULL ) == 0
pnewrdn->bv_val, deloldrdn,
pnewSuperior ? pnewSuperior->bv_val : NULL ) == 0
#ifdef SLAPD_MULTIMASTER
&& ( !be->be_update_ndn.bv_len || !repl_user )
#endif
@ -395,7 +396,7 @@ do_modrdn(
moddn.deloldrdn = deloldrdn;
moddn.newsup = pnewSuperior;
replog( be, op, pdn->bv_val, ndn->bv_val, &moddn );
replog( be, op, pdn, ndn, &moddn );
}
#ifndef SLAPD_MULTIMASTER
} else {

View file

@ -457,7 +457,8 @@ LDAP_SLAPD_F (int) parse_limit LDAP_P(( const char *arg,
* lock.c
*/
LDAP_SLAPD_F (FILE *) lock_fopen LDAP_P(( const char *fname, const char *type, FILE **lfp ));
LDAP_SLAPD_F (FILE *) lock_fopen LDAP_P(( const char *fname,
const char *type, FILE **lfp ));
LDAP_SLAPD_F (int) lock_fclose LDAP_P(( FILE *fp, FILE *lfp ));
@ -545,9 +546,12 @@ LDAP_SLAPD_F (char *) phonetic LDAP_P(( char *s ));
/*
* repl.c
*/
LDAP_SLAPD_F (int) add_replica_info LDAP_P(( Backend *be, const char *host ));
LDAP_SLAPD_F (int) add_replica_suffix LDAP_P(( Backend *be, int nr, const char *suffix ));
LDAP_SLAPD_F (void) replog LDAP_P(( Backend *be, Operation *op, char *dn, char *ndn, void *change ));
LDAP_SLAPD_F (int) add_replica_info LDAP_P(( Backend *be,
const char *host ));
LDAP_SLAPD_F (int) add_replica_suffix LDAP_P(( Backend *be,
int nr, const char *suffix ));
LDAP_SLAPD_F (void) replog LDAP_P(( Backend *be, Operation *op,
struct berval *dn, struct berval *ndn, void *change ));
/*
* referral.c

View file

@ -77,8 +77,8 @@ void
replog(
Backend *be,
Operation *op,
char *dn,
char *ndn,
struct berval *dn,
struct berval *ndn,
void *change
)
{
@ -104,14 +104,13 @@ replog(
return;
}
for ( i = 0; be->be_replica != NULL && be->be_replica[i] != NULL;
i++ ) {
for ( i = 0; be->be_replica != NULL && be->be_replica[i] != NULL; i++ ) {
/* 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]; j++ ) {
if ( dn_issuffix( ndn, be->be_replica[i]->ri_nsuffix[j]->bv_val ) ) {
if ( dnIsSuffix( ndn, be->be_replica[i]->ri_nsuffix[j] ) ) {
break;
}
}
@ -140,7 +139,7 @@ replog(
#endif
fprintf( fp, "time: %ld\n", (long) slap_get_time() );
fprintf( fp, "dn: %s\n", dn );
fprintf( fp, "dn: %s\n", dn->bv_val );
switch ( op->o_tag ) {
case LDAP_REQ_EXTENDED:
@ -169,7 +168,8 @@ replog(
}
for ( i = 0; ml->sml_bvalues != NULL &&
ml->sml_bvalues[i] != NULL; i++ ) {
ml->sml_bvalues[i] != NULL; i++ )
{
char *buf, *bufp;
len = ml->sml_desc->ad_cname.bv_len;
@ -178,8 +178,7 @@ replog(
buf = (char *) ch_malloc( len );
bufp = buf;
ldif_sput( &bufp, LDIF_PUT_VALUE,
type,
ldif_sput( &bufp, LDIF_PUT_VALUE, type,
ml->sml_bvalues[i]->bv_val,
ml->sml_bvalues[i]->bv_len );
*bufp = '\0';