Module: kamailio
Branch: master
Commit: 2cb677247ccbb31bc76c0fd0ed0cd8e2b5b933eb
URL:
https://github.com/kamailio/kamailio/commit/2cb677247ccbb31bc76c0fd0ed0cd8e…
Author: Armen Babikyan <armen(a)firespotter.com>
Committer: Henning Westerholt <henningw(a)users.noreply.github.com>
Date: 2018-08-15T09:04:30+02:00
permissions: check for db_url being set on reload
---
Modified: src/modules/permissions/address.c
Modified: src/modules/permissions/trusted.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2cb677247ccbb31bc76c0fd0ed0cd8e…
Patch:
https://github.com/kamailio/kamailio/commit/2cb677247ccbb31bc76c0fd0ed0cd8e…
---
diff --git a/src/modules/permissions/address.c b/src/modules/permissions/address.c
index cc447deaf6..7a8999ea34 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) {
@@ -621,4 +626,4 @@ int allow_address_group(struct sip_msg* _msg, char* _addr, char*
_port)
}
return ki_allow_address_group(_msg, &ips, port);
-}
\ No newline at end of file
+}
diff --git a/src/modules/permissions/trusted.c b/src/modules/permissions/trusted.c
index 06e3142321..9943cbd137 100644
--- a/src/modules/permissions/trusted.c
+++ b/src/modules/permissions/trusted.c
@@ -636,6 +636,11 @@ int allow_trusted_3(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) {