sssd/0035-SYSDB-Fix-error-handling-in-sysdb_get_user_members_r.patch

52 lines
1.8 KiB
Diff
Raw Normal View History

From 223395a44a3016c3124aa5ed841c7023068607d8 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Tue, 30 Aug 2016 15:37:43 +0200
Subject: [PATCH 35/39] SYSDB: Fix error handling in
sysdb_get_user_members_recursively
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We ignored failures from sysdb_search_entry
Reviewed-by: Petr Čech <pcech@redhat.com>
(cherry picked from commit b969ccc2cc58fdf761e5d314de9217f2d914bc9b)
---
src/db/sysdb_ops.c | 3 +++
src/db/sysdb_views.c | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 44fb5b70e6d33fffbca5824f831a3229254ecb57..e4c8e1e285e3bc49710f71c896ba9a30c742d4fa 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -4738,6 +4738,9 @@ errno_t sysdb_get_user_members_recursively(TALLOC_CTX *mem_ctx,
ret = sysdb_search_entry(tmp_ctx, dom->sysdb, base_dn, LDB_SCOPE_SUBTREE,
filter, attrs, &count, &msgs);
+ if (ret != EOK) {
+ goto done;
+ }
res = talloc_zero(tmp_ctx, struct ldb_result);
if (res == NULL) {
diff --git a/src/db/sysdb_views.c b/src/db/sysdb_views.c
index 79f513d13ba41212a6cd84e1d9e609df6acba29c..9dc48f5b6c414bbc7c64bcd1fe73553f388588bd 100644
--- a/src/db/sysdb_views.c
+++ b/src/db/sysdb_views.c
@@ -1374,7 +1374,10 @@ errno_t sysdb_add_group_member_overrides(struct sss_domain_info *domain,
ret = sysdb_get_user_members_recursively(tmp_ctx, domain, obj->dn,
&res_members);
- if (ret != EOK) {
+ if (ret == ENOENT) {
+ ret = EOK;
+ goto done;
+ } else if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
"sysdb_get_user_members_recursively failed.\n");
goto done;
--
2.9.3