From db29d319838642f68caf99fc5cf4e022301fc4fe Mon Sep 17 00:00:00 2001 From: Hans Zandbelt Date: Fri, 6 Sep 2024 14:35:13 +0200 Subject: [PATCH] allow overriding globally set OIDCCacheType back to shm in vhosts Signed-off-by: Hans Zandbelt --- ChangeLog | 4 ++++ src/cfg/cache.c | 4 ++-- src/cfg/cfg.c | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b7c16d3..8ab1afaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ +09/06/2024 +- allow overriding globally set OIDCCacheType back to shm in vhosts + 09/05/2024 - fix OIDCCacheShmMax min/max settings; see #1260; thanks @bbartke +- bump to 2.4.16.3dev 08/30/2024 - release 2.4.16.2 diff --git a/src/cfg/cache.c b/src/cfg/cache.c index cc8a4083..baf59739 100644 --- a/src/cfg/cache.c +++ b/src/cfg/cache.c @@ -344,7 +344,7 @@ static void oidc_cfg_cache_redis_merge_server_config(oidc_cfg_t *c, oidc_cfg_t * * generic */ void oidc_cfg_cache_create_server_config(oidc_cfg_t *c) { - c->cache.impl = &oidc_cache_shm; + c->cache.impl = NULL; c->cache.cfg = NULL; c->cache.encrypt = OIDC_CONFIG_POS_INT_UNSET; oidc_cfg_cache_shm_create_server_config(c); @@ -358,7 +358,7 @@ void oidc_cfg_cache_create_server_config(oidc_cfg_t *c) { } void oidc_cfg_cache_merge_server_config(oidc_cfg_t *c, oidc_cfg_t *base, oidc_cfg_t *add) { - c->cache.impl = (add->cache.impl != &oidc_cache_shm) ? add->cache.impl : base->cache.impl; + c->cache.impl = (add->cache.impl != NULL) ? add->cache.impl : base->cache.impl; c->cache.encrypt = add->cache.encrypt != OIDC_CONFIG_POS_INT_UNSET ? add->cache.encrypt : base->cache.encrypt; c->cache.cfg = NULL; oidc_cfg_cache_shm_merge_server_config(c, base, add); diff --git a/src/cfg/cfg.c b/src/cfg/cfg.c index 1e504acb..de30a584 100644 --- a/src/cfg/cfg.c +++ b/src/cfg/cfg.c @@ -858,6 +858,8 @@ oidc_cache_mutex_t *oidc_cfg_refresh_mutex_get(oidc_cfg_t *cfg) { } int oidc_cfg_post_config(oidc_cfg_t *cfg, server_rec *s) { + if (cfg->cache.impl == NULL) + cfg->cache.impl = &oidc_cache_shm; if (cfg->cache.impl->post_config != NULL) { if (cfg->cache.impl->post_config(s) != OK) return HTTP_INTERNAL_SERVER_ERROR;