File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1+ 09/13/2025
2+ - redis: apply global (server-wide) locking when system(!) environment variable
3+ OIDC_REDIS_MUTEX_GLOBAL is set, for backwards compatibility, through:
4+ PassEnv OIDC_REDIS_MUTEX_GLOBAL
5+
1609/12/2025
27- test: add util/*.c coverage tests
38
Original file line number Diff line number Diff line change 4646#include "cache/redis.h"
4747#include "cfg/cfg_int.h"
4848
49- // TODO: proper Redis error reporting (server unreachable etc.)
50-
5149#define REDIS_CONNECT_TIMEOUT_DEFAULT 5
5250#define REDIS_TIMEOUT_DEFAULT 5
5351#define REDIS_KEEPALIVE_DEFAULT -1
5452
53+ #define OIDC_REDIS_MUTEX_GLOBAL_ENV_VAR "OIDC_REDIS_MUTEX_GLOBAL"
54+
5555/* create the cache context */
5656static oidc_cache_cfg_redis_t * oidc_cache_redis_cfg_create (apr_pool_t * pool ) {
5757 oidc_cache_cfg_redis_t * context = apr_pcalloc (pool , sizeof (oidc_cache_cfg_redis_t ));
58- context -> mutex = oidc_cache_mutex_create (pool , FALSE);
58+ context -> mutex = oidc_cache_mutex_create (pool , getenv ( OIDC_REDIS_MUTEX_GLOBAL_ENV_VAR ) ? TRUE : FALSE);
5959 context -> username = NULL ;
6060 context -> passwd = NULL ;
6161 context -> database = -1 ;
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ char *oidc_util_html_escape(apr_pool_t *pool, const char *s) {
6161 unsigned int m = 0 ;
6262 const char * ptr = chars ;
6363 unsigned int len = _oidc_strlen (ptr );
64- char * r = apr_pcalloc (pool , _oidc_strlen (s ) * 6 );
64+ char * r = apr_pcalloc (pool , _oidc_strlen (s ) * 6 + 1 );
6565 for (i = 0 ; i < _oidc_strlen (s ); i ++ ) {
6666 for (n = 0 ; n < len ; n ++ ) {
6767 if (s [i ] == chars [n ]) {
You can’t perform that action at this time.
0 commit comments