From 6d4430c2a6ae34012dabb95f82b32f7e8068700b Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 25 Mar 2011 12:59:22 -0400 Subject: Always complete the transaction in sdap_process_group_members_2307 If the loop ran through at least one sdap_process_missing_member_2307() call and errored out later, we were not canceling the transaction. --- src/providers/ldap/sdap_async_accounts.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/providers') diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c index 003cf037d..8447942c6 100644 --- a/src/providers/ldap/sdap_async_accounts.c +++ b/src/providers/ldap/sdap_async_accounts.c @@ -1231,6 +1231,7 @@ sdap_process_group_members_2307(struct sdap_process_group_state *state, char *member_name; char *strdn; int ret; + errno_t sret; int i; for (i=0; i < memberel->num_values; i++) { @@ -1282,12 +1283,22 @@ sdap_process_group_members_2307(struct sdap_process_group_state *state, DEBUG(2, ("Cannot commit sysdb transaction\n")); goto done; } + in_transaction = false; } ret = EOK; memberel->values = talloc_steal(state->group, state->sysdb_dns->values); memberel->num_values = state->sysdb_dns->num_values; + done: + if (in_transaction) { + /* If the transaction is still active here, we need to cancel it */ + sret = sysdb_transaction_cancel(state->sysdb); + if (sret != EOK) { + DEBUG(0, ("Unable to cancel transaction! [%d][%s]\n", + sret, strerror(sret))); + } + } return ret; } -- cgit