From f77ba726e3f8bd1e3cabdee66f38c4ed7a771913 Mon Sep 17 00:00:00 2001 From: Petr Cech Date: May 11 2016 10:50:11 +0000 Subject: NEGCACHE: Adding getter for timeout It adds new function to negative cache API: * int sss_ncache_get_timeout(struct sss_nc_ctx *ctx); Resolves: https://fedorahosted.org/sssd/ticket/2317 Reviewed-by: Pavel Březina --- diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c index d48402f..1488c12 100644 --- a/src/responder/common/negcache.c +++ b/src/responder/common/negcache.c @@ -78,6 +78,11 @@ int sss_ncache_init(TALLOC_CTX *memctx, uint32_t timeout, return EOK; }; +uint32_t sss_ncache_get_timeout(struct sss_nc_ctx *ctx) +{ + return ctx->timeout; +} + static int sss_ncache_check_str(struct sss_nc_ctx *ctx, char *str) { TDB_DATA key; diff --git a/src/responder/common/negcache.h b/src/responder/common/negcache.h index 8c805b2..572c723 100644 --- a/src/responder/common/negcache.h +++ b/src/responder/common/negcache.h @@ -28,6 +28,8 @@ struct sss_nc_ctx; int sss_ncache_init(TALLOC_CTX *memctx, uint32_t timeout, struct sss_nc_ctx **_ctx); +uint32_t sss_ncache_get_timeout(struct sss_nc_ctx *ctx); + /* check if the user is expired according to the passed in time to live */ int sss_ncache_check_user(struct sss_nc_ctx *ctx, struct sss_domain_info *dom, const char *name);