You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sssd/SOURCES/0007-SSS_CLIENT-MC-in-case-...

49 lines
1.4 KiB

From 160738ee8e4eaf59cf81eae13fa65a4b53700c0d Mon Sep 17 00:00:00 2001
From: Alexey Tikhonov <atikhono@redhat.com>
Date: Fri, 8 Dec 2023 19:02:24 +0100
Subject: [PATCH 7/9] SSS_CLIENT: MC: in case mem-cache file validation fails,
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
don't return anything but EINVAL, because `_nss_sss_*()` functions
can have a special handling for other error codes (for ERANGE in
particular).
Reviewed-by: Alejandro López <allopez@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
Reviewed-by: Tomáš Halman <thalman@redhat.com>
(cherry picked from commit 958a5e25c447dc502e8f8fbecf3253e62f92b0b2)
---
src/sss_client/nss_mc_common.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/sss_client/nss_mc_common.c b/src/sss_client/nss_mc_common.c
index e227c0bae..37119fa8d 100644
--- a/src/sss_client/nss_mc_common.c
+++ b/src/sss_client/nss_mc_common.c
@@ -79,17 +79,17 @@ static errno_t sss_nss_mc_validate(struct sss_cli_mc_ctx *ctx)
}
if (fstat(ctx->fd, &fdstat) == -1) {
- return errno;
+ return EINVAL;
}
/* Memcache was removed. */
if (fdstat.st_nlink == 0) {
- return ENOENT;
+ return EINVAL;
}
/* Invalid size. */
if (fdstat.st_size != ctx->mmap_size) {
- return ERANGE;
+ return EINVAL;
}
return EOK;
--
2.41.0