]> git.sur5r.net Git - openldap/commitdiff
Have replog() use struct berval DNs
authorKurt Zeilenga <kurt@openldap.org>
Tue, 25 Dec 2001 04:09:09 +0000 (04:09 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 25 Dec 2001 04:09:09 +0000 (04:09 +0000)
servers/slapd/add.c
servers/slapd/delete.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/proto-slap.h
servers/slapd/repl.c

index 458cdbaa08438f5ea564932f026ed591d7475df8..c8d5b04d4ece8d285113ecd2ccb2ae60cdc8ad12 100644 (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;
index 2eeb56daacaf548d324511fba3af5abdfd954590..08c3d24686b52e93191f9365619da995abd5fc6b 100644 (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
index 80adab778e1fb40510a46b6a76778d1d8856ba61..9b1ece0d29f39aeac59ddfcaa4d6945154cf0120 100644 (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
index 5160f1e89227babfc2edce9ea07e4ac2c990212e..cb3d6238db1b32ae986e280dadbc8167d23ce2e0 100644 (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 {
index ee071973a946c10b47bc46e4ce0d5cc741dd4d70..1f2ffdefc07661f7be67ddd42abdcd813152963f 100644 (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
index 634cb2373d42f4ca6805809b29120c2188491853..32d0dee09fe16bd17363746b23ea74467e2d04eb 100644 (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';