summaryrefslogtreecommitdiffstats
path: root/src/responder/sudo/sudosrv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/responder/sudo/sudosrv.c')
-rw-r--r--src/responder/sudo/sudosrv.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/responder/sudo/sudosrv.c b/src/responder/sudo/sudosrv.c
index 841be43ef..6b7eae07b 100644
--- a/src/responder/sudo/sudosrv.c
+++ b/src/responder/sudo/sudosrv.c
@@ -129,6 +129,27 @@ int sudo_process_init(TALLOC_CTX *mem_ctx,
sudo_dp_reconnect_init, iter);
}
+ /* Get responder options */
+
+ /* Get cache_timeout option */
+ ret = confdb_get_int(sudo_ctx->rctx->cdb, sudo_ctx,
+ CONFDB_SUDO_CONF_ENTRY, CONFDB_SUDO_CACHE_TIMEOUT,
+ CONFDB_DEFAULT_SUDO_CACHE_TIMEOUT,
+ &sudo_ctx->cache_timeout);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_FATAL_FAILURE, ("Error reading from confdb (%d) [%s]\n",
+ ret, strerror(ret)));
+ return ret;
+ }
+
+ /* Initialize in-memory cache */
+ ret = sudosrv_cache_init(sudo_ctx, 10, &sudo_ctx->cache);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_FATAL_FAILURE,
+ ("Could not create hash table: [%s]", strerror(ret)));
+ return ret;
+ }
+
DEBUG(SSSDBG_TRACE_FUNC, ("SUDO Initialization complete\n"));
return EOK;