summaryrefslogtreecommitdiffstats
path: root/src/responder/pac
diff options
context:
space:
mode:
authorPavel Reichl <preichl@redhat.com>2014-12-09 11:01:13 +0000
committerSumit Bose <sbose@redhat.com>2014-12-17 15:57:34 +0100
commit4bbcc2d6d3f16b015796818746a45134861c93a4 (patch)
tree0f569c29ae1357dd2acbd73b030e01d7b37875a0 /src/responder/pac
parentd7b90921c1a404f0d9fb8384a8fd55fd15b86916 (diff)
downloadsssd-4bbcc2d6d3f16b015796818746a45134861c93a4.tar.gz
sssd-4bbcc2d6d3f16b015796818746a45134861c93a4.tar.xz
sssd-4bbcc2d6d3f16b015796818746a45134861c93a4.zip
SYSDB: sysdb_search_object_by_sid returns ENOENT
sysdb_search_object_by_sid returns ENOENT if no results are found. Part od solution for: https://fedorahosted.org/sssd/ticket/1991 Fixes: https://fedorahosted.org/sssd/ticket/2520 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/responder/pac')
-rw-r--r--src/responder/pac/pacsrv_cmd.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/responder/pac/pacsrv_cmd.c b/src/responder/pac/pacsrv_cmd.c
index cc9259289..07d2f0cf7 100644
--- a/src/responder/pac/pacsrv_cmd.c
+++ b/src/responder/pac/pacsrv_cmd.c
@@ -297,17 +297,17 @@ static void pac_lookup_sids_done(struct tevent_req *req)
msg = NULL;
ret = sysdb_search_object_by_sid(pr_ctx, dom, entries[c].key.str,
NULL, &msg);
- if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_object_by_sid " \
- "failed.\n");
+ if (ret == ENOENT) {
+ DEBUG(SSSDBG_OP_FAILURE, "No entry found for SID [%s].\n",
+ entries[c].key.str);
+ continue;
+ } else if (ret != EOK) {
+ DEBUG(SSSDBG_OP_FAILURE,
+ "sysdb_search_object_by_sid failed.\n");
continue;
}
- 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) {
+ if (msg->count > 1) {
DEBUG(SSSDBG_CRIT_FAILURE, "More then one result returned " \
"for SID [%s].\n",
entries[c].key.str);
@@ -911,10 +911,13 @@ pac_store_membership(struct pac_req_ctx *pr_ctx,
ret = sysdb_search_object_by_sid(tmp_ctx, grp_dom, grp_sid_str,
group_attrs, &group);
- if (ret != EOK) {
- DEBUG(SSSDBG_TRACE_INTERNAL, "sysdb_search_object_by_sid " \
- "for SID [%s] failed [%d][%s].\n",
- grp_sid_str, ret, strerror(ret));
+ if (ret == ENOENT) {
+ DEBUG(SSSDBG_OP_FAILURE, "Unexpected number of groups returned.\n");
+ goto done;
+ } else if (ret != EOK) {
+ DEBUG(SSSDBG_TRACE_INTERNAL,
+ "sysdb_search_object_by_sid for SID [%s] failed [%d][%s].\n",
+ grp_sid_str, ret, strerror(ret));
goto done;
}