Skip to content

Commit

Permalink
allow overriding globally set OIDCCacheType back to shm in vhosts
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Sep 6, 2024
1 parent 0d4d507 commit db29d31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/cfg/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/cfg/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit db29d31

Please sign in to comment.