Skip to content

Commit 5c4d65b

Browse files
committed
code: avoid embedding defines in macro arguments
re-enable SonarQube Signed-off-by: Hans Zandbelt <hans.zandbelt@openidc.com>
1 parent 5521109 commit 5c4d65b

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed
File renamed without changes.

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
12/11/2024
22
- code: loop over authz arrays with index instead of pointer
3+
- code: avoid embedding defines in macro arguments
34

45
12/10/2024
56
- github: add SonarQube analysis to Github workflows

src/cfg/cmds.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,19 +255,23 @@ const command_rec oidc_cfg_cmds[] = {
255255

256256
// cache
257257

258+
#ifdef USE_MEMCACHE
259+
#define _OIDC_CMDS_CACHE_TYPE_MEMCACHE "'memcache'|"
260+
#else
261+
#define _OIDC_CMDS_CACHE_TYPE_MEMCACHE
262+
#endif
263+
#ifdef USE_LIBHIREDIS
264+
#define _OIDC_CMDS_CACHE_TYPE_REDIS "'redis'|"
265+
#else
266+
#define _OIDC_CMDS_CACHE_TYPE_REDIS
267+
#endif
268+
258269
AP_INIT_TAKE1(
259270
OIDCCacheType,
260271
oidc_cmd_cache_type_set,
261272
NULL,
262273
RSRC_CONF,
263-
"cache backend must be one of ['shm'|"
264-
#ifdef USE_MEMCACHE
265-
"'memcache'|"
266-
#endif
267-
#ifdef USE_LIBHIREDIS
268-
"'redis'|"
269-
#endif
270-
"'file']."),
274+
"cache backend must be one of ['shm'|" _OIDC_CMDS_CACHE_TYPE_MEMCACHE _OIDC_CMDS_CACHE_TYPE_REDIS "'file']."),
271275
OIDC_CFG_CMD(
272276
AP_INIT_TAKE1,
273277
OIDCCacheEncrypt,

src/mod_auth_openidc.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,28 +1665,28 @@ static int oidc_post_config(apr_pool_t *pool, apr_pool_t *p1, apr_pool_t *p2, se
16651665
return OK;
16661666
}
16671667

1668-
ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
1669-
"%s - init - cjose %s, %s, EC=%s, GCM=%s, Memcache=%s, Redis=%s, JQ=%s", NAMEVERSION,
1670-
cjose_version(), oidc_util_openssl_version(s->process->pool), OIDC_JOSE_EC_SUPPORT ? "yes" : "no",
1671-
OIDC_JOSE_GCM_SUPPORT ? "yes" : "no",
16721668
#ifdef USE_MEMCACHE
1673-
"yes"
1669+
#define _OIDC_USE_MEMCACHE "yes"
16741670
#else
1675-
"no"
1671+
#define _OIDC_USE_MEMCACHE "no"
16761672
#endif
1677-
,
1673+
16781674
#ifdef USE_LIBHIREDIS
1679-
"yes"
1675+
#define _OIDC_USE_REDIS "yes"
16801676
#else
1681-
"no"
1677+
#define _OIDC_USE_REDIS "no"
16821678
#endif
1683-
,
1679+
16841680
#ifdef USE_LIBJQ
1685-
"yes"
1681+
#define _OIDC_USE_JQ "yes"
16861682
#else
1687-
"no"
1683+
#define _OIDC_USE_JQ "no"
16881684
#endif
1689-
);
1685+
1686+
ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
1687+
"%s - init - cjose %s, %s, EC=%s, GCM=%s, Memcache=%s, Redis=%s, JQ=%s", NAMEVERSION,
1688+
cjose_version(), oidc_util_openssl_version(s->process->pool), OIDC_JOSE_EC_SUPPORT ? "yes" : "no",
1689+
OIDC_JOSE_GCM_SUPPORT ? "yes" : "no", _OIDC_USE_MEMCACHE, _OIDC_USE_REDIS, _OIDC_USE_JQ);
16901690

16911691
oidc_http_init();
16921692

0 commit comments

Comments
 (0)