Module: kamailio
Branch: master
Commit: 30eec549396899eae32e651ef58d65c4684ab296
URL:
https://github.com/kamailio/kamailio/commit/30eec549396899eae32e651ef58d65c…
Author: Joel Centelles <joel_centellesmartin(a)baxter.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-06-20T10:45:31+02:00
db_redis: Fixing global variables
Adding module name prefix to global variables to reduce possible conflicts.
---
Modified: src/modules/db_redis/db_redis_mod.c
Modified: src/modules/db_redis/redis_connection.c
---
Diff:
https://github.com/kamailio/kamailio/commit/30eec549396899eae32e651ef58d65c…
Patch:
https://github.com/kamailio/kamailio/commit/30eec549396899eae32e651ef58d65c…
---
diff --git a/src/modules/db_redis/db_redis_mod.c b/src/modules/db_redis/db_redis_mod.c
index 026abeb148..89da232083 100644
--- a/src/modules/db_redis/db_redis_mod.c
+++ b/src/modules/db_redis/db_redis_mod.c
@@ -31,9 +31,9 @@
#ifdef WITH_SSL
int db_redis_opt_tls = 0;
-char *ca_path = 0;
+char *db_redis_ca_path = 0;
#endif
-char *db_pass = 0;
+char *db_redis_db_pass = 0;
MODULE_VERSION
@@ -60,9 +60,9 @@ static param_export_t params[] = {
{"verbosity", PARAM_INT, &db_redis_verbosity},
#ifdef WITH_SSL
{"opt_tls", PARAM_INT, &db_redis_opt_tls},
- {"ca_path", PARAM_STRING, &ca_path},
+ {"ca_path", PARAM_STRING, &db_redis_ca_path},
#endif
- {"db_pass", PARAM_STRING, &db_pass}, {0, 0, 0}};
+ {"db_pass", PARAM_STRING, &db_redis_db_pass}, {0, 0, 0}};
struct module_exports exports = {
diff --git a/src/modules/db_redis/redis_connection.c
b/src/modules/db_redis/redis_connection.c
index f38b6698d4..0bf001d152 100644
--- a/src/modules/db_redis/redis_connection.c
+++ b/src/modules/db_redis/redis_connection.c
@@ -37,9 +37,9 @@ static unsigned int MAX_URL_LENGTH = 1023;
extern int db_redis_verbosity;
#ifdef WITH_SSL
extern int db_redis_opt_tls;
-extern char *ca_path;
+extern char *db_redis_ca_path;
#endif
-extern char *db_pass;
+extern char *db_redis_db_pass;
static void print_query(redis_key_t *query)
{
@@ -164,7 +164,7 @@ int db_redis_connect(km_redis_con_t *con)
if(db_redis_opt_tls != 0) {
/* Create SSL context*/
redisInitOpenSSL();
- ssl = redisCreateSSLContext(NULL, ca_path, NULL, NULL, NULL, NULL);
+ ssl = redisCreateSSLContext(NULL, db_redis_ca_path, NULL, NULL, NULL, NULL);
if(ssl == NULL) {
LM_ERR("Unable to create Redis SSL Context.\n");
goto err;
@@ -208,7 +208,7 @@ int db_redis_connect(km_redis_con_t *con)
if(db_redis_opt_tls != 0) {
/* Create SSL context*/
redisInitOpenSSL();
- ssl = redisCreateSSLContext(NULL, ca_path, NULL, NULL, NULL, NULL);
+ ssl = redisCreateSSLContext(NULL, db_redis_ca_path, NULL, NULL, NULL, NULL);
if(ssl == NULL) {
LM_ERR("Unable to create Redis SSL Context.\n");
goto err;
@@ -236,7 +236,7 @@ int db_redis_connect(km_redis_con_t *con)
password = con->id->password;
if(!password) {
- password = db_pass;
+ password = db_redis_db_pass;
}
if(password) {
reply = redisCommand(con->con, "AUTH %s", password);