[SSSD] [PATCH] PAC: do not expect that sysdb_search_object_by_sid() return ENOENT
Sumit Bose
sbose at redhat.com
Tue Jun 18 15:30:09 UTC 2013
Hi,
one of the issues reported in
https://bugzilla.redhat.com/show_bug.cgi?id=975001 is a core dump in the
PAC responder. I thought that I can find missing results by checking for
ENOENT which is wrong in this case. This patch properly checks the
number of results.
bye,
Sumit
-------------- next part --------------
From c6943b2331a3d2a1cf4affcdae4795a946e72239 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Tue, 18 Jun 2013 15:42:02 +0200
Subject: [PATCH] PAC: do not expect that sysdb_search_object_by_sid() return
ENOENT
sysdb_search_object_by_sid() does not return ENOENT if no related object
was found in the cache but EOK and an empty result list.
Fixes https://fedorahosted.org/sssd/ticket/1989
---
src/responder/pac/pacsrv_cmd.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/responder/pac/pacsrv_cmd.c b/src/responder/pac/pacsrv_cmd.c
index 3edf035..479a094 100644
--- a/src/responder/pac/pacsrv_cmd.c
+++ b/src/responder/pac/pacsrv_cmd.c
@@ -288,16 +288,16 @@ static void pac_lookup_sids_done(struct tevent_req *req)
ret = sysdb_search_object_by_sid(pr_ctx, dom->sysdb, dom,
entries[c].key.str, NULL, &msg);
if (ret != EOK) {
- if (ret == ENOENT) {
- DEBUG(SSSDBG_OP_FAILURE, ("No entry found for SID [%s].\n",
- entries[c].key.str));
- } else {
- DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_object_by_sid " \
- "failed.\n"));
- }
+ DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_object_by_sid " \
+ "failed.\n"));
continue;
}
- if (msg->count > 1) {
+
+ if (msg->count == 0) {
+ DEBUG(SSSDBG_OP_FAILURE, ("No entry found for SID [%s].\n",
+ entries[c].key.str));
+ continue;
+ } else if (msg->count > 1) {
DEBUG(SSSDBG_CRIT_FAILURE, ("More then one result returned " \
"for SID [%s].\n",
entries[c].key.str));
--
1.7.7.6
More information about the sssd-devel
mailing list