diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-03-29 16:30:27 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-04-09 08:35:20 +0200 |
commit | 0d19785f9ffd9c66df5b30d208ec7b0216a9555b (patch) | |
tree | fa11cac980dba90b196538cd68de11eae11ada4d /src/responder | |
parent | 1aa492ce890f362564bfac21f3cfb0a3e38608bd (diff) | |
download | sssd-0d19785f9ffd9c66df5b30d208ec7b0216a9555b.tar.gz sssd-0d19785f9ffd9c66df5b30d208ec7b0216a9555b.tar.xz sssd-0d19785f9ffd9c66df5b30d208ec7b0216a9555b.zip |
ncache: Add sss_ncache_reset_repopulate_permanent
This new function resets the negative cache and then re-adds the
permanent entries.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/responder')
-rw-r--r-- | src/responder/common/negcache.c | 14 | ||||
-rw-r--r-- | src/responder/common/negcache.h | 6 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c index 3e58c3e7f..2fa61af53 100644 --- a/src/responder/common/negcache.c +++ b/src/responder/common/negcache.c @@ -838,3 +838,17 @@ done: talloc_free(tmpctx); return ret; } + +/* Reset permanent negcache after checking the domains */ +errno_t sss_ncache_reset_repopulate_permanent(struct resp_ctx *rctx, + struct sss_nc_ctx *ncache) +{ + int ret; + + ret = sss_ncache_reset_permanent(ncache); + if (ret == EOK) { + ret = sss_ncache_prepopulate(ncache, rctx->cdb, rctx); + } + + return ret; +} diff --git a/src/responder/common/negcache.h b/src/responder/common/negcache.h index 00f979dbb..b96fbfda5 100644 --- a/src/responder/common/negcache.h +++ b/src/responder/common/negcache.h @@ -69,6 +69,8 @@ int sss_ncache_set_service_port(struct sss_nc_ctx *ctx, bool permanent, int sss_ncache_reset_permanent(struct sss_nc_ctx *ctx); +struct resp_ctx; + /* Set up the negative cache with values from filter_users and * filter_groups in the sssd.conf */ @@ -76,4 +78,8 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache, struct confdb_ctx *cdb, struct resp_ctx *rctx); +/* Flush the negcache and then repopulate */ +errno_t sss_ncache_reset_repopulate_permanent(struct resp_ctx *rctx, + struct sss_nc_ctx *ncache); + #endif /* _NSS_NEG_CACHE_H_ */ |