diff options
author | Petr Cech <pcech@redhat.com> | 2016-04-22 04:27:47 -0400 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-05-11 12:49:45 +0200 |
commit | 39d36216a1692eee6cc5359f6c7ccaa7789be76d (patch) | |
tree | 41aca8c466b35959ba9f9302b4f943b23e55bc87 /src/responder/common/negcache.c | |
parent | 73dd89c3fb361dab43b4802510f4c64d282dbde1 (diff) | |
download | sssd-39d36216a1692eee6cc5359f6c7ccaa7789be76d.tar.gz sssd-39d36216a1692eee6cc5359f6c7ccaa7789be76d.tar.xz sssd-39d36216a1692eee6cc5359f6c7ccaa7789be76d.zip |
NEGCACHE: Adding timeout to struct sss_nc_ctx
It adds timeout of negative cache to handling
struct sss_nc_ctx.
There is one change in API of negatice cache:
* int sss_ncache_init(TALLOC_CTX *memctx,
uint32_t timeout, <----- new
struct sss_nc_ctx **_ctx);
There is also one new function in common/responder:
* errno_t responder_get_neg_timeout_from_confdb(struct confdb_ctx *cdb,
uint32_t *ncache_timeout);
Resolves:
https://fedorahosted.org/sssd/ticket/2317
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/responder/common/negcache.c')
-rw-r--r-- | src/responder/common/negcache.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c index 1617bf8c5..57d196902 100644 --- a/src/responder/common/negcache.c +++ b/src/responder/common/negcache.c @@ -39,6 +39,7 @@ struct sss_nc_ctx { struct tdb_context *tdb; + uint32_t timeout; }; typedef int (*ncache_set_byname_fn_t)(struct sss_nc_ctx *, bool, @@ -58,7 +59,8 @@ static int string_to_tdb_data(char *str, TDB_DATA *ret) return EOK; } -int sss_ncache_init(TALLOC_CTX *memctx, struct sss_nc_ctx **_ctx) +int sss_ncache_init(TALLOC_CTX *memctx, uint32_t timeout, + struct sss_nc_ctx **_ctx) { struct sss_nc_ctx *ctx; @@ -70,6 +72,8 @@ int sss_ncache_init(TALLOC_CTX *memctx, struct sss_nc_ctx **_ctx) ctx->tdb = tdb_open("memcache", 0, TDB_INTERNAL, O_RDWR|O_CREAT, 0); if (!ctx->tdb) return errno; + ctx->timeout = timeout; + *_ctx = ctx; return EOK; }; |