diff --git a/debian/patches/series b/debian/patches/series index 6c87349f4..7c0bdf6c1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -63,6 +63,8 @@ sipwise/usrloc-don-t-synchronize-on-destroy-for-DB_ONLY.patch sipwise/presence_offline_cleanup.patch ### active development sipwise/permissions-don-t-allow-reloads-in-the-middle-of-ong.patch +sipwise/permissions_consider_db_mode_when_rpc_reload.patch + ### Don't just put stuff in any order ### use gbp pq import/export tooling to help maintain patches ### diff --git a/debian/patches/sipwise/permissions_consider_db_mode_when_rpc_reload.patch b/debian/patches/sipwise/permissions_consider_db_mode_when_rpc_reload.patch new file mode 100644 index 000000000..ee3fb948d --- /dev/null +++ b/debian/patches/sipwise/permissions_consider_db_mode_when_rpc_reload.patch @@ -0,0 +1,26 @@ +--- a/src/modules/permissions/rpc.c ++++ b/src/modules/permissions/rpc.c +@@ -60,12 +60,19 @@ void rpc_trusted_reload(rpc_t *rpc, void + return; + } + +- if(reload_trusted_table_cmd() != 1) { +- rpc->fault(c, 500, "Reload failed."); +- goto done; ++ // only reload the hash buckets then, when the cache is activated (db_mode = 1) ++ if(perm_db_mode == ENABLE_CACHE) { ++ if(reload_trusted_table_cmd() != 1) { ++ rpc->fault(c, 500, "Reload failed."); ++ goto done; ++ } ++ rpc->rpl_printf(c, "Reload OK"); ++ } else { ++ LM_DBG("Skip trusted sources reload in hash buckets, caching is " ++ "disabled.\n"); ++ rpc->fault(c, 500, "Reload skipped (disabled cache)"); + } + +- rpc->rpl_printf(c, "Reload OK"); + done: + // reloading is done + *perm_rpc_reload_time = time(NULL);