[sr-dev] git:master:2cb67724: permissions: check for db_url being set on reload
Henning Westerholt
henningw at users.noreply.github.com
Wed Aug 15 09:04:36 CEST 2018
Module: kamailio
Branch: master
Commit: 2cb677247ccbb31bc76c0fd0ed0cd8e2b5b933eb
URL: https://github.com/kamailio/kamailio/commit/2cb677247ccbb31bc76c0fd0ed0cd8e2b5b933eb
Author: Armen Babikyan <armen at firespotter.com>
Committer: Henning Westerholt <henningw at 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/2cb677247ccbb31bc76c0fd0ed0cd8e2b5b933eb.diff
Patch: https://github.com/kamailio/kamailio/commit/2cb677247ccbb31bc76c0fd0ed0cd8e2b5b933eb.patch
---
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) {
More information about the sr-dev
mailing list