]> git.sur5r.net Git - openldap/commitdiff
FIx up replog calls, add replog call to bdb passwd
authorKurt Zeilenga <kurt@openldap.org>
Tue, 25 Dec 2001 18:20:35 +0000 (18:20 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 25 Dec 2001 18:20:35 +0000 (18:20 +0000)
servers/slapd/back-bdb/passwd.c
servers/slapd/back-ldbm/passwd.c
servers/slapd/tools/mimic.c

index 5959f336185d671745dea4ac60e33eecd3d3df7b..450a7d32739cb350550726e81ec9f39b8a377f50 100644 (file)
@@ -184,27 +184,30 @@ retry:    /* transaction retry */
                        goto done;
                }
 
-       }
+               /* change the entry itself */
+               rc = bdb_id2entry_update( be, ltid, e );
+               if( rc != 0 ) {
+                       switch(rc) {
+                       case DB_LOCK_DEADLOCK:
+                       case DB_LOCK_NOTGRANTED:
+                               bdb_entry_return( be, e );
+                               e = NULL;
+                               goto retry;
+                       }
+                       *text = "entry update failed";
+                       rc = LDAP_OTHER;
+               }
 
-       /* change the entry itself */
-       rc = bdb_id2entry_update( be, ltid, e );
-       if( rc != 0 ) {
-               switch(rc) {
-               case DB_LOCK_DEADLOCK:
-               case DB_LOCK_NOTGRANTED:
-                       bdb_entry_return( be, e );
-                       e = NULL;
-                       goto retry;
+               if( bdb->bi_txn && rc == 0 ) {
+                       rc = txn_commit( ltid, 0 );
+                       ltid = NULL;
                }
-               *text = "entry update failed";
-               rc = LDAP_OTHER;
-       }
+               op->o_private = NULL;
 
-       if( bdb->bi_txn && rc == 0 ) {
-               rc = txn_commit( ltid, 0 );
-               ltid = NULL;
+               if( rc == LDAP_SUCCESS ) {
+                       replog( be, op, &e->e_name, &e->e_nname, &ml );
+               }
        }
-       op->o_private = NULL;
 
 done:
        if( e != NULL ) {
index 2dcbabad24ee8afe6aa08cf5c809083cf9bd0347..a45c95a57a1f39bc142d966462153554cad4e438 100644 (file)
@@ -162,9 +162,11 @@ ldbm_back_exop_passwd(
                        rc = LDAP_OTHER;
                }
 
-               replog( be, op, e->e_dn, e->e_ndn, &ml );
+               if( rc == LDAP_SUCCESS ) {
+                       replog( be, op, &e->e_name, &e->e_nname, &ml );
+               }
        }
-       
+
 done:
        if( e != NULL ) {
                cache_return_entry_w( &li->li_cache, e );
index 50e8325af49117588e053029b76ae99451f0f91f..528504de2b7597169a6a4e40ccb23e1ed731eef6 100644 (file)
@@ -186,7 +186,8 @@ const char * connection_state2str( int state )
        return NULL;
 }
 
-void replog( Backend *be, Operation *op, char *dn, char *ndn, void *change)
+void replog( Backend *be, Operation *op,
+       struct berval *dn, struct berval *ndn, void *change)
 {
        assert(0);
 }