summaryrefslogtreecommitdiff
path: root/src
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:47 -0400
commit97bd239c546febf20008e4e2d8a959b91c738d1f (patch)
tree2acfa50f7e1c62d9466fbaac21cc61a179267530 /src
parentb0caecbc976a443afc3be96f89ce7d923e282622 (diff)
downloadsssd-97bd239c546febf20008e4e2d8a959b91c738d1f.tar.gz
sssd-97bd239c546febf20008e4e2d8a959b91c738d1f.tar.bz2
sssd-97bd239c546febf20008e4e2d8a959b91c738d1f.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.
Diffstat (limited to 'src')
-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 003cf037..8447942c 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;
}