summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-03-25 12:59:22 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-03-28 11:42:27 -0400
commit6d4430c2a6ae34012dabb95f82b32f7e8068700b (patch)
tree9e0337ad762c745572a602c66f80361ba71b8487
parent4e39e55ec5b6dbad8596a30fc5ab4bb54abbe344 (diff)
downloadsssd-6d4430c2a6ae34012dabb95f82b32f7e8068700b.tar.gz
sssd-6d4430c2a6ae34012dabb95f82b32f7e8068700b.tar.xz
sssd-6d4430c2a6ae34012dabb95f82b32f7e8068700b.zip
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.
-rw-r--r--src/providers/ldap/sdap_async_accounts.c11
1 files changed, 11 insertions, 0 deletions
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;
}