eabdullin
d0b0fe0ac8
- DP: reduce log level in case a responder asks for unknown domain - ipa: Add `BUILD_PASSKEY` conditional for passkey codepath - LDAP: make groups_by_user_send/recv public - Makefile: Respect `BUILD_PASSKEY` conditional - pam: Conditionalize passkey code - sdap: add set_non_posix parameter - SSS_CLIENT: check if mem-cache fd was hijacked - SSS_CLIENT: check if reponder socket was hijacked - SSS_CLIENT: MC: in case mem-cache file validation fails - sysdb: remove sysdb_computer.[ch]
45 lines
1.3 KiB
Diff
45 lines
1.3 KiB
Diff
From 958a5e25c447dc502e8f8fbecf3253e62f92b0b2 Mon Sep 17 00:00:00 2001
|
|
From: Alexey Tikhonov <atikhono@redhat.com>
|
|
Date: Fri, 8 Dec 2023 19:02:24 +0100
|
|
Subject: [PATCH] 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>
|
|
---
|
|
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 e227c0bae3..37119fa8d3 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;
|