Skip to content

Commit

Permalink
SSS_CLIENT: MC: in case mem-cache file validation fails,
Browse files Browse the repository at this point in the history
don't return anything but EINVAL, because `_nss_sss_*()` functions
can have a special handling for other error codes (for ERANGE in
particular).
  • Loading branch information
alexey-tikhonov committed Dec 8, 2023
1 parent c236081 commit 7a7b8b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sss_client/nss_mc_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7a7b8b7

Please sign in to comment.