summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Cech <pcech@redhat.com>2016-04-22 07:10:15 -0400
committerJakub Hrozek <jhrozek@redhat.com>2016-05-11 12:50:11 +0200
commitf77ba726e3f8bd1e3cabdee66f38c4ed7a771913 (patch)
tree31d05985ea677cb85d5f3ed02fdf2b22ea0f0e83
parent0393f0d44ac92035de29a8bc8b2005db6d90b640 (diff)
downloadsssd-f77ba726e3f8bd1e3cabdee66f38c4ed7a771913.tar.gz
sssd-f77ba726e3f8bd1e3cabdee66f38c4ed7a771913.tar.xz
sssd-f77ba726e3f8bd1e3cabdee66f38c4ed7a771913.zip
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 <pbrezina@redhat.com>
-rw-r--r--src/responder/common/negcache.c5
-rw-r--r--src/responder/common/negcache.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c
index d48402f8e..1488c12a8 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 8c805b24b..572c723cc 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);