From 78066c08c0650e5b1e7e205946d409e3dd10e73b Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 27 Nov 2001 01:09:19 +0000 Subject: [PATCH] Fixed exit code processing. passwd.c never committed its password change tranasaction. --- servers/slapd/back-bdb/add.c | 3 ++- servers/slapd/back-bdb/delete.c | 3 ++- servers/slapd/back-bdb/passwd.c | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 120d3f601d..6a804b31d9 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -258,7 +258,8 @@ retry: rc = txn_abort( ltid ); } /* attribute indexes */ - if ( bdb_index_entry_add( be, ltid, e, e->e_attrs ) != LDAP_SUCCESS ) { + rc = bdb_index_entry_add( be, ltid, e, e->e_attrs ); + if ( rc != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, "bdb_add: index_entry_add failed\n", 0, 0, 0 ); switch( rc ) { diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index cb0f1b70e0..7f77513993 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -265,7 +265,8 @@ retry: /* transaction retry */ } /* delete from id2entry */ - if ( bdb_id2entry_delete( be, ltid, e->e_id ) != 0 ) { + rc = bdb_id2entry_delete( be, ltid, e->e_id ); + if ( rc != 0 ) { switch( rc ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: diff --git a/servers/slapd/back-bdb/passwd.c b/servers/slapd/back-bdb/passwd.c index 3642eacfc5..e7d7b02a12 100644 --- a/servers/slapd/back-bdb/passwd.c +++ b/servers/slapd/back-bdb/passwd.c @@ -195,6 +195,13 @@ retry: /* transaction retry */ } *text = "entry update failed"; rc = LDAP_OTHER; + } else + { + rc = txn_commit( ltid, 0 ); + ltid = NULL; + op->o_private = NULL; + if (rc) + *text = "commit failed"; } done: