Module: kamailio
Branch: 5.0
Commit: f949edc0798d92275dc340da0c06a6fddeb7ee3c
URL:
https://github.com/kamailio/kamailio/commit/f949edc0798d92275dc340da0c06a6f…
Author: Armen Babikyan <armen(a)firespotter.com>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-08-15T21:17:40+02:00
permissions: check for db_url being set on reload
(cherry picked from commit 2cb677247ccbb31bc76c0fd0ed0cd8e2b5b933eb)
---
Modified: src/modules/permissions/address.c
Modified: src/modules/permissions/trusted.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f949edc0798d92275dc340da0c06a6f…
Patch:
https://github.com/kamailio/kamailio/commit/f949edc0798d92275dc340da0c06a6f…
---
diff --git a/src/modules/permissions/address.c b/src/modules/permissions/address.c
index 46d135bf6d..0f19dd9a39 100644
--- a/src/modules/permissions/address.c
+++ b/src/modules/permissions/address.c
@@ -255,6 +255,11 @@ int reload_address_table(void)
*/
int reload_address_table_cmd(void)
{
+ if(!db_url.s) {
+ LM_ERR("db_url not set\n");
+ return -1;
+ }
+
if (!db_handle) {
db_handle = perm_dbf.init(&db_url);
if (!db_handle) {
diff --git a/src/modules/permissions/trusted.c b/src/modules/permissions/trusted.c
index f953338d96..c357293f3c 100644
--- a/src/modules/permissions/trusted.c
+++ b/src/modules/permissions/trusted.c
@@ -585,6 +585,11 @@ int allow_trusted_2(struct sip_msg* _msg, char* _src_ip_sp, char*
_proto_sp)
int reload_trusted_table_cmd(void)
{
+ if(!db_url.s) {
+ LM_ERR("db_url not set\n");
+ return -1;
+ }
+
if (!db_handle) {
db_handle = perm_dbf.init(&db_url);
if (!db_handle) {