From 16be48f4763fcfa79bd7a0eb3af84cd6d36e19c2 Mon Sep 17 00:00:00 2001 From: pedrosam Date: Nov 07 2019 12:17:23 +0000 Subject: cache_req: propagate multiple entries error to the caller Explanation: Propagate error when multiple entries with same certificate have been found when only one was expected Resolves: https://pagure.io/SSSD/sssd/issue/2710 Reviewed-by: Pavel Březina --- diff --git a/src/responder/common/cache_req/cache_req_search.c b/src/responder/common/cache_req/cache_req_search.c index 8732145..f3454ba 100644 --- a/src/responder/common/cache_req/cache_req_search.c +++ b/src/responder/common/cache_req/cache_req_search.c @@ -226,7 +226,7 @@ static errno_t cache_req_search_cache(TALLOC_CTX *mem_ctx, CACHE_REQ_DEBUG(SSSDBG_CRIT_FAILURE, cr, "Multiple objects were found when " "only one was expected!\n"); - ret = ERR_INTERNAL; + ret = ERR_MULTIPLE_ENTRIES; goto done; } diff --git a/src/util/util_errors.c b/src/util/util_errors.c index 9f36967..0148958 100644 --- a/src/util/util_errors.c +++ b/src/util/util_errors.c @@ -123,6 +123,7 @@ struct err_string error_to_str[] = { { "The last GetAccountDomain() result is still valid" }, /* ERR_GET_ACCT_DOM_CACHED */ { "ID is outside the allowed range" }, /* ERR_ID_OUTSIDE_RANGE */ { "Group ID is duplicated" }, /* ERR_GID_DUPLICATED */ + { "Multiple objects were found when only one was expected" }, /* ERR_MULTIPLE_ENTRIES */ /* DBUS Errors */ { "Connection was killed on demand" }, /* ERR_SBUS_KILL_CONNECTION */ diff --git a/src/util/util_errors.h b/src/util/util_errors.h index ae21991..ec31a9e 100644 --- a/src/util/util_errors.h +++ b/src/util/util_errors.h @@ -144,6 +144,7 @@ enum sssd_errors { ERR_GET_ACCT_DOM_CACHED, ERR_ID_OUTSIDE_RANGE, ERR_GID_DUPLICATED, + ERR_MULTIPLE_ENTRIES, /* DBUS Errors */ ERR_SBUS_KILL_CONNECTION,