summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ipa/ipa_access.c3
-rw-r--r--src/providers/ipa/ipa_hbac_common.c10
-rw-r--r--src/providers/ipa/ipa_selinux.c5
-rw-r--r--src/providers/ipa/ipa_selinux_common.c12
-rw-r--r--src/providers/krb5/krb5_auth.c16
-rw-r--r--src/providers/ldap/ldap_id_cleanup.c3
-rw-r--r--src/providers/ldap/sdap_async_groups.c27
-rw-r--r--src/providers/ldap/sdap_async_initgroups.c74
-rw-r--r--src/providers/ldap/sdap_async_services.c5
-rw-r--r--src/providers/ldap/sdap_async_sudo.c7
-rw-r--r--src/providers/ldap/sdap_async_users.c13
-rw-r--r--src/providers/proxy/proxy_id.c34
-rw-r--r--src/providers/proxy/proxy_services.c6
13 files changed, 167 insertions, 48 deletions
diff --git a/src/providers/ipa/ipa_access.c b/src/providers/ipa/ipa_access.c
index 571085e5a..d3fb158f0 100644
--- a/src/providers/ipa/ipa_access.c
+++ b/src/providers/ipa/ipa_access.c
@@ -572,9 +572,10 @@ static void hbac_sysdb_save(struct tevent_req *req)
ret = sysdb_transaction_commit(sysdb);
if (ret != EOK) {
- DEBUG(0, ("Failed to commit transaction\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
goto fail;
}
+ in_transaction = false;
/* We don't need the rule data any longer,
* the rest of the processing relies on
diff --git a/src/providers/ipa/ipa_hbac_common.c b/src/providers/ipa/ipa_hbac_common.c
index af0000cff..341b56223 100644
--- a/src/providers/ipa/ipa_hbac_common.c
+++ b/src/providers/ipa/ipa_hbac_common.c
@@ -111,7 +111,10 @@ ipa_hbac_sysdb_save(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
/* Save the entries and groups to the cache */
ret = sysdb_transaction_start(sysdb);
- if (ret != EOK) return ret;
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
+ goto done;
+ };
in_transaction = true;
/* First, save the specific entries */
@@ -143,7 +146,10 @@ ipa_hbac_sysdb_save(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
}
ret = sysdb_transaction_commit(sysdb);
- if (ret != EOK) goto done;
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
+ goto done;
+ }
in_transaction = false;
done:
diff --git a/src/providers/ipa/ipa_selinux.c b/src/providers/ipa/ipa_selinux.c
index b5a84269e..36a2bfb4a 100644
--- a/src/providers/ipa/ipa_selinux.c
+++ b/src/providers/ipa/ipa_selinux.c
@@ -123,7 +123,10 @@ static void ipa_selinux_handler_done(struct tevent_req *req)
}
ret = sysdb_transaction_start(sysdb);
- if (ret != EOK) goto fail;
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
+ goto fail;
+ }
in_transaction = true;
ret = sysdb_delete_usermaps(breq->sysdb);
diff --git a/src/providers/ipa/ipa_selinux_common.c b/src/providers/ipa/ipa_selinux_common.c
index a01e0b6cb..45794388f 100644
--- a/src/providers/ipa/ipa_selinux_common.c
+++ b/src/providers/ipa/ipa_selinux_common.c
@@ -32,12 +32,16 @@ errno_t ipa_save_user_maps(struct sysdb_ctx *sysdb,
struct sysdb_attrs **maps)
{
errno_t ret;
+ errno_t sret;
+ bool in_transaction = false;
int i;
ret = sysdb_transaction_start(sysdb);
if (ret) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto done;
}
+ in_transaction = true;
for (i = 0; i < map_count; i++) {
ret = sysdb_store_selinux_usermap(sysdb, maps[i]);
@@ -54,9 +58,15 @@ errno_t ipa_save_user_maps(struct sysdb_ctx *sysdb,
DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n"));
goto done;
}
-
+ in_transaction = false;
ret = EOK;
done:
+ if (in_transaction) {
+ sret = sysdb_transaction_cancel(sysdb);
+ if (sret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction"));
+ }
+ }
return ret;
}
diff --git a/src/providers/krb5/krb5_auth.c b/src/providers/krb5/krb5_auth.c
index 1da1d0253..c3a9e62de 100644
--- a/src/providers/krb5/krb5_auth.c
+++ b/src/providers/krb5/krb5_auth.c
@@ -121,6 +121,8 @@ static int krb5_mod_ccname(TALLOC_CTX *mem_ctx,
TALLOC_CTX *tmpctx;
struct sysdb_attrs *attrs;
int ret;
+ errno_t sret;
+ bool in_transaction = false;
if (name == NULL || ccname == NULL) {
DEBUG(1, ("Missing user or ccache name.\n"));
@@ -154,9 +156,11 @@ static int krb5_mod_ccname(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb);
if (ret != EOK) {
- DEBUG(6, ("Error %d starting transaction (%s)\n", ret, strerror(ret)));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Error %d starting transaction (%s)\n", ret, strerror(ret)));
goto done;
}
+ in_transaction = true;
ret = sysdb_set_user_attr(sysdb, name, attrs, mod_op);
if (ret != EOK) {
@@ -167,10 +171,18 @@ static int krb5_mod_ccname(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_commit(sysdb);
if (ret != EOK) {
- DEBUG(1, ("Failed to commit transaction!\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n"));
+ goto done;
}
+ in_transaction = false;
done:
+ if (in_transaction) {
+ sret = sysdb_transaction_cancel(sysdb);
+ if (sret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n"));
+ }
+ }
talloc_zfree(tmpctx);
return ret;
}
diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c
index 3460b8cc6..e65356d58 100644
--- a/src/providers/ldap/ldap_id_cleanup.c
+++ b/src/providers/ldap/ldap_id_cleanup.c
@@ -192,6 +192,7 @@ struct tevent_req *ldap_id_cleanup_send(TALLOC_CTX *memctx,
ret = sysdb_transaction_start(state->ctx->be->sysdb);
if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto fail;
}
in_transaction = true;
@@ -209,8 +210,10 @@ struct tevent_req *ldap_id_cleanup_send(TALLOC_CTX *memctx,
ret = sysdb_transaction_commit(state->ctx->be->sysdb);
if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
goto fail;
}
+ in_transaction = false;
tevent_req_done(req);
tevent_req_post(req, ev);
diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c
index 1c651c1a8..ac5057e8c 100644
--- a/src/providers/ldap/sdap_async_groups.c
+++ b/src/providers/ldap/sdap_async_groups.c
@@ -522,10 +522,12 @@ static int sdap_save_groups(TALLOC_CTX *memctx,
char *usn_value;
bool twopass;
int ret;
+ errno_t sret;
int i;
struct sysdb_attrs **saved_groups = NULL;
int nsaved_groups = 0;
time_t now;
+ bool in_transaction = false;
switch (opts->schema_type) {
case SDAP_SCHEMA_RFC2307:
@@ -549,8 +551,10 @@ static int sdap_save_groups(TALLOC_CTX *memctx,
ret = sysdb_transaction_start(sysdb);
if (ret) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto done;
}
+ in_transaction = true;
if (twopass && !populate_members) {
saved_groups = talloc_array(tmpctx, struct sysdb_attrs *,
@@ -616,15 +620,22 @@ static int sdap_save_groups(TALLOC_CTX *memctx,
ret = sysdb_transaction_commit(sysdb);
if (ret) {
- DEBUG(1, ("Failed to commit transaction!\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n"));
goto done;
}
+ in_transaction = false;
if (_usn_value) {
*_usn_value = talloc_steal(memctx, higher_usn);
}
done:
+ if (in_transaction) {
+ sret = sysdb_transaction_cancel(sysdb);
+ if (sret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n"));
+ }
+ }
talloc_zfree(tmpctx);
return ret;
}
@@ -1864,6 +1875,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx,
hash_key_t key;
hash_value_t value;
size_t count;
+ bool in_transaction = false;
if (_ghosts == NULL) {
return EINVAL;
@@ -1886,9 +1898,10 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb);
if (ret) {
- DEBUG(1, ("Failed to start transaction!\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction!\n"));
goto done;
}
+ in_transaction = true;
for (i = 0; i < num_users; i++) {
ret = sysdb_attrs_primary_name(sysdb, users[i],
@@ -1973,17 +1986,21 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_commit(sysdb);
if (ret) {
- DEBUG(1, ("Failed to commit transaction!\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n"));
goto done;
}
+ in_transaction = false;
ret = EOK;
done:
- if (ret != EOK) {
+ if (in_transaction) {
sret = sysdb_transaction_cancel(sysdb);
if (sret != EOK) {
- DEBUG(2, ("Could not cancel transaction\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n"));
}
+ }
+
+ if (ret != EOK) {
*_ghosts = NULL;
} else {
*_ghosts = talloc_steal(mem_ctx, ghosts);
diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c
index a1c73f960..d55f661ff 100644
--- a/src/providers/ldap/sdap_async_initgroups.c
+++ b/src/providers/ldap/sdap_async_initgroups.c
@@ -42,6 +42,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
char **missing;
gid_t gid;
int ret;
+ errno_t sret;
bool in_transaction = false;
bool posix;
time_t now;
@@ -57,18 +58,10 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
missing = talloc_array(tmp_ctx, char *, ldap_groups_count+1);
if (!missing) {
ret = ENOMEM;
- goto fail;
+ goto done;
}
mi = 0;
- ret = sysdb_transaction_start(sysdb);
- if (ret != EOK) {
- DEBUG(1, ("Cannot start sysdb transaction [%d]: %s\n",
- ret, strerror(ret)));
- goto fail;
- }
- in_transaction = true;
-
for (i=0; groupnames[i]; i++) {
ret = sysdb_search_group_by_name(tmp_ctx, sysdb, groupnames[i], NULL, &msg);
if (ret == EOK) {
@@ -82,7 +75,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
} else if (ret != ENOENT) {
DEBUG(1, ("search for group failed [%d]: %s\n",
ret, strerror(ret)));
- goto fail;
+ goto done;
}
}
missing[mi] = NULL;
@@ -93,6 +86,16 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
goto done;
}
+ ret = sysdb_transaction_start(sysdb);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Cannot start sysdb transaction [%d]: %s\n",
+ ret, strerror(ret)));
+ goto done;
+ }
+ in_transaction = true;
+
+
now = time(NULL);
for (i=0; missing[i]; i++) {
/* The group is not in sysdb, need to add a fake entry */
@@ -102,7 +105,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
&name);
if (ret != EOK) {
DEBUG(1, ("The group has no name attribute\n"));
- goto fail;
+ goto done;
}
if (strcmp(name, missing[i]) == 0) {
@@ -116,7 +119,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
tmp_ctx, opts->idmap_ctx, ldap_groups[ai],
opts->group_map[SDAP_AT_GROUP_OBJECTSID].sys_name,
&sid_str);
- if (ret != EOK) goto fail;
+ if (ret != EOK) goto done;
DEBUG(SSSDBG_TRACE_INTERNAL,
("Group [%s] has objectSID [%s]\n",
@@ -151,7 +154,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
posix = false;
} else if (ret) {
DEBUG(1, ("The GID attribute is malformed\n"));
- goto fail;
+ goto done;
}
}
@@ -167,7 +170,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
ret = sysdb_add_incomplete_group(sysdb, name, gid, original_dn,
posix, now);
if (ret != EOK) {
- goto fail;
+ goto done;
}
break;
}
@@ -176,21 +179,24 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
if (ai == ldap_groups_count) {
DEBUG(2, ("Group %s not present in LDAP\n", missing[i]));
ret = EINVAL;
- goto fail;
+ goto done;
}
}
-done:
ret = sysdb_transaction_commit(sysdb);
if (ret != EOK) {
- DEBUG(1, ("sysdb_transaction_commit failed.\n"));
- goto fail;
+ DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_transaction_commit failed.\n"));
+ goto done;
}
in_transaction = false;
ret = EOK;
-fail:
+
+done:
if (in_transaction) {
- sysdb_transaction_cancel(sysdb);
+ sret = sysdb_transaction_cancel(sysdb);
+ if (sret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n"));
+ }
}
talloc_free(tmp_ctx);
return ret;
@@ -1964,6 +1970,7 @@ errno_t save_rfc2307bis_user_memberships(
DEBUG(7, ("Save parent groups to sysdb\n"));
ret = sysdb_transaction_start(state->sysdb);
if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto error;
}
in_transaction = true;
@@ -2012,6 +2019,7 @@ errno_t save_rfc2307bis_user_memberships(
ret = sysdb_transaction_commit(state->sysdb);
if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
goto error;
}
in_transaction = false;
@@ -2630,8 +2638,10 @@ static void sdap_get_initgr_user(struct tevent_req *subreq)
struct sysdb_attrs **usr_attrs;
size_t count;
int ret;
+ errno_t sret;
const char *orig_dn;
const char *cname;
+ bool in_transaction = false;
DEBUG(9, ("Receiving info for the user\n"));
@@ -2666,9 +2676,10 @@ static void sdap_get_initgr_user(struct tevent_req *subreq)
ret = sysdb_transaction_start(state->sysdb);
if (ret) {
- tevent_req_error(req, ret);
- return;
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
+ goto fail;
}
+ in_transaction = true;
DEBUG(9, ("Storing the user\n"));
@@ -2677,18 +2688,17 @@ static void sdap_get_initgr_user(struct tevent_req *subreq)
state->orig_user,
true, NULL, 0);
if (ret) {
- sysdb_transaction_cancel(state->sysdb);
- tevent_req_error(req, ret);
- return;
+ goto fail;
}
DEBUG(9, ("Commit change\n"));
ret = sysdb_transaction_commit(state->sysdb);
if (ret) {
- tevent_req_error(req, ret);
- return;
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
+ goto fail;
}
+ in_transaction = false;
ret = sysdb_get_real_name(state, state->sysdb, state->name, &cname);
if (ret != EOK) {
@@ -2760,6 +2770,16 @@ static void sdap_get_initgr_user(struct tevent_req *subreq)
tevent_req_error(req, EINVAL);
return;
}
+
+ return;
+fail:
+ if (in_transaction) {
+ sret = sysdb_transaction_cancel(state->sysdb);
+ if (sret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n"));
+ }
+ }
+ tevent_req_error(req, ret);
}
static int sdap_initgr_rfc2307bis_recv(struct tevent_req *req);
diff --git a/src/providers/ldap/sdap_async_services.c b/src/providers/ldap/sdap_async_services.c
index a59db6c66..026fa13f9 100644
--- a/src/providers/ldap/sdap_async_services.c
+++ b/src/providers/ldap/sdap_async_services.c
@@ -273,7 +273,10 @@ sdap_save_services(TALLOC_CTX *mem_ctx,
}
ret = sysdb_transaction_start(sysdb);
- if (ret != EOK) goto done;
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
+ goto done;
+ }
in_transaction = true;
diff --git a/src/providers/ldap/sdap_async_sudo.c b/src/providers/ldap/sdap_async_sudo.c
index db5e056d9..86edcc343 100644
--- a/src/providers/ldap/sdap_async_sudo.c
+++ b/src/providers/ldap/sdap_async_sudo.c
@@ -480,6 +480,7 @@ static void sdap_sudo_load_sudoers_done(struct tevent_req *subreq)
/* start transaction */
ret = sysdb_transaction_start(state->sysdb);
if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto done;
}
in_transaction = true;
@@ -502,9 +503,11 @@ static void sdap_sudo_load_sudoers_done(struct tevent_req *subreq)
/* commit transaction */
ret = sysdb_transaction_commit(state->sysdb);
- if (ret == EOK) {
- in_transaction = false;
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
+ goto done;
}
+ in_transaction = false;
DEBUG(SSSDBG_TRACE_FUNC, ("Sudoers is successfuly stored in cache\n"));
diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c
index dfce319b2..8974e6a24 100644
--- a/src/providers/ldap/sdap_async_users.c
+++ b/src/providers/ldap/sdap_async_users.c
@@ -377,8 +377,10 @@ int sdap_save_users(TALLOC_CTX *memctx,
char *higher_usn = NULL;
char *usn_value;
int ret;
+ errno_t sret;
int i;
time_t now;
+ bool in_transaction = false;
if (num_users == 0) {
/* Nothing to do if there are no users */
@@ -392,8 +394,10 @@ int sdap_save_users(TALLOC_CTX *memctx,
ret = sysdb_transaction_start(sysdb);
if (ret) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto done;
}
+ in_transaction = true;
now = time(NULL);
for (i = 0; i < num_users; i++) {
@@ -428,15 +432,22 @@ int sdap_save_users(TALLOC_CTX *memctx,
ret = sysdb_transaction_commit(sysdb);
if (ret) {
- DEBUG(1, ("Failed to commit transaction!\n"));
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n"));
goto done;
}
+ in_transaction = false;
if (_usn_value) {
*_usn_value = talloc_steal(memctx, higher_usn);
}
done:
+ if (in_transaction) {
+ sret = sysdb_transaction_cancel(sysdb);
+ if (sret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n"));
+ }
+ }
talloc_zfree(tmpctx);
return ret;
}
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
index 9a179209d..451bdff5b 100644
--- a/src/providers/proxy/proxy_id.c
+++ b/src/providers/proxy/proxy_id.c
@@ -353,6 +353,7 @@ static int enum_users(TALLOC_CTX *mem_ctx,
char *buffer;
char *newbuf;
int ret;
+ errno_t sret;
bool again;
DEBUG(SSSDBG_TRACE_LIBS, ("Enumerating users\n"));
@@ -377,6 +378,7 @@ static int enum_users(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb);
if (ret) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto done;
}
in_transaction = true;
@@ -420,6 +422,10 @@ static int enum_users(TALLOC_CTX *mem_ctx,
DEBUG(SSSDBG_TRACE_LIBS, ("Enumeration completed.\n"));
ret = sysdb_transaction_commit(sysdb);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
+ goto done;
+ }
in_transaction = false;
break;
@@ -468,7 +474,10 @@ static int enum_users(TALLOC_CTX *mem_ctx,
done:
talloc_zfree(tmpctx);
if (in_transaction) {
- sysdb_transaction_cancel(sysdb);
+ sret = sysdb_transaction_cancel(sysdb);
+ if (sret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n"));
+ }
}
ctx->ops.endpwent();
return ret;
@@ -518,7 +527,10 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom,
DEBUG_GR_MEM(7, grp);
ret = sysdb_transaction_start(sysdb);
- if (ret != EOK) goto done;
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
+ goto done;
+ }
in_transaction = true;
if (grp->gr_mem && grp->gr_mem[0]) {
@@ -948,6 +960,7 @@ static int enum_groups(TALLOC_CTX *mem_ctx,
char *buffer;
char *newbuf;
int ret;
+ errno_t sret;
bool again;
DEBUG(SSSDBG_TRACE_LIBS, ("Enumerating groups\n"));
@@ -972,6 +985,7 @@ static int enum_groups(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb);
if (ret) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto done;
}
in_transaction = true;
@@ -1015,6 +1029,10 @@ static int enum_groups(TALLOC_CTX *mem_ctx,
DEBUG(SSSDBG_TRACE_LIBS, ("Enumeration completed.\n"));
ret = sysdb_transaction_commit(sysdb);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
+ goto done;
+ }
in_transaction = false;
break;
@@ -1062,7 +1080,10 @@ static int enum_groups(TALLOC_CTX *mem_ctx,
done:
talloc_zfree(tmpctx);
if (in_transaction) {
- sysdb_transaction_cancel(sysdb);
+ sret = sysdb_transaction_cancel(sysdb);
+ if (sret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n"));
+ }
}
ctx->ops.endgrent();
return ret;
@@ -1090,6 +1111,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
char *buffer;
size_t buflen;
int ret;
+ errno_t sret;
bool del_user;
uid_t uid;
struct ldb_result *cached_pwd = NULL;
@@ -1115,6 +1137,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb);
if (ret) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto fail;
}
in_transaction = true;
@@ -1212,7 +1235,10 @@ done:
fail:
talloc_zfree(tmpctx);
if (in_transaction) {
- sysdb_transaction_cancel(sysdb);
+ sret = sysdb_transaction_cancel(sysdb);
+ if (sret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n"));
+ }
}
return ret;
}
diff --git a/src/providers/proxy/proxy_services.c b/src/providers/proxy/proxy_services.c
index aa19ccb68..4f8a379bb 100644
--- a/src/providers/proxy/proxy_services.c
+++ b/src/providers/proxy/proxy_services.c
@@ -223,6 +223,7 @@ enum_services(struct proxy_id_ctx *ctx,
ret = sysdb_transaction_start(sysdb);
if (ret) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n"));
goto done;
}
in_transaction = true;
@@ -266,7 +267,10 @@ enum_services(struct proxy_id_ctx *ctx,
DEBUG(SSSDBG_TRACE_FUNC, ("Enumeration completed.\n"));
ret = sysdb_transaction_commit(sysdb);
- if (ret != EOK) goto done;
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n"));
+ goto done;
+ }
in_transaction = false;
break;