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