diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2011-03-25 12:59:22 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-03-28 11:42:47 -0400 |
commit | 97bd239c546febf20008e4e2d8a959b91c738d1f (patch) | |
tree | 2acfa50f7e1c62d9466fbaac21cc61a179267530 /src/providers/ldap/sdap_async_accounts.c | |
parent | b0caecbc976a443afc3be96f89ce7d923e282622 (diff) | |
download | sssd-97bd239c546febf20008e4e2d8a959b91c738d1f.tar.gz sssd-97bd239c546febf20008e4e2d8a959b91c738d1f.tar.xz 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/providers/ldap/sdap_async_accounts.c')
-rw-r--r-- | src/providers/ldap/sdap_async_accounts.c | 11 |
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; } |