Module: kamailio
Branch: 5.1
Commit: 0c3350c785722fae33a65a2588c0b2545f4d3b02
URL:
https://github.com/kamailio/kamailio/commit/0c3350c785722fae33a65a2588c0b25…
Author: Armen Babikyan <armen(a)firespotter.com>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-08-15T21:16:18+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/0c3350c785722fae33a65a2588c0b25…
Patch:
https://github.com/kamailio/kamailio/commit/0c3350c785722fae33a65a2588c0b25…
---
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) {