From 721f83fa5661c861674c17edbb309bb9ade15892 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Mon, 4 Jul 2016 14:08:46 +0200
Subject: [PATCH 11/14] nss-srv-tests: Fix prototype of wrapped ncache
functions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The argument ttl was recently removed from negative cache functions
(sss_ncache_check_user, sss_ncache_check_uid, sss_ncache_check_sid,
sss_ncache_check_cert) but it was not removed from wrapped versions
in nss-srv-tests. It caused a crash on machine with big endian
and when configure wih --coverage.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
(cherry picked from commit 35567de112cd5d82acb582cbdb44c8652bbdfda1)
---
src/tests/cmocka/test_nss_srv.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/src/tests/cmocka/test_nss_srv.c b/src/tests/cmocka/test_nss_srv.c
index 5e0398f20b9906df39371826e50a9c78675dfa74..4137e9151be561a57a8f2e674f385ecb37119255 100644
--- a/src/tests/cmocka/test_nss_srv.c
+++ b/src/tests/cmocka/test_nss_srv.c
@@ -151,60 +151,56 @@ int __wrap_sss_cmd_send_empty(struct cli_ctx *cctx, TALLOC_CTX *freectx)
}
/* Intercept negative cache lookups */
-int __real_sss_ncache_check_user(struct sss_nc_ctx *ctx, int ttl,
+int __real_sss_ncache_check_user(struct sss_nc_ctx *ctx,
struct sss_domain_info *dom, const char *name);
-int __wrap_sss_ncache_check_user(struct sss_nc_ctx *ctx, int ttl,
+int __wrap_sss_ncache_check_user(struct sss_nc_ctx *ctx,
struct sss_domain_info *dom, const char *name)
{
int ret;
- ret = __real_sss_ncache_check_user(ctx, ttl, dom, name);
+ ret = __real_sss_ncache_check_user(ctx, dom, name);
if (ret == EEXIST) {
nss_test_ctx->ncache_hits++;
}
return ret;
}
-int __real_sss_ncache_check_uid(struct sss_nc_ctx *ctx, int ttl,
+int __real_sss_ncache_check_uid(struct sss_nc_ctx *ctx,
struct sss_domain_info *dom, uid_t uid);
-int __wrap_sss_ncache_check_uid(struct sss_nc_ctx *ctx, int ttl,
+int __wrap_sss_ncache_check_uid(struct sss_nc_ctx *ctx,
struct sss_domain_info *dom, uid_t uid)
{
int ret;
- ret = __real_sss_ncache_check_uid(ctx, ttl, dom, uid);
+ ret = __real_sss_ncache_check_uid(ctx, dom, uid);
if (ret == EEXIST) {
nss_test_ctx->ncache_hits++;
}
return ret;
}
-int __real_sss_ncache_check_sid(struct sss_nc_ctx *ctx,
- int ttl, const char *sid);
+int __real_sss_ncache_check_sid(struct sss_nc_ctx *ctx, const char *sid);
-int __wrap_sss_ncache_check_sid(struct sss_nc_ctx *ctx,
- int ttl, const char *sid)
+int __wrap_sss_ncache_check_sid(struct sss_nc_ctx *ctx, const char *sid)
{
int ret;
- ret = __real_sss_ncache_check_sid(ctx, ttl, sid);
+ ret = __real_sss_ncache_check_sid(ctx, sid);
if (ret == EEXIST) {
nss_test_ctx->ncache_hits++;
}
return ret;
}
-int __real_sss_ncache_check_cert(struct sss_nc_ctx *ctx,
- int ttl, const char *cert);
+int __real_sss_ncache_check_cert(struct sss_nc_ctx *ctx, const char *cert);
-int __wrap_sss_ncache_check_cert(struct sss_nc_ctx *ctx,
- int ttl, const char *cert)
+int __wrap_sss_ncache_check_cert(struct sss_nc_ctx *ctx, const char *cert)
{
int ret;
- ret = __real_sss_ncache_check_cert(ctx, ttl, cert);
+ ret = __real_sss_ncache_check_cert(ctx, cert);
if (ret == EEXIST) {
nss_test_ctx->ncache_hits++;
}
--
2.4.11