Skip to content

Commit

Permalink
usrloc: Fix some incorrect startup checks
Browse files Browse the repository at this point in the history
On some misconfigured scripts (e.g. DB usrloc + db_url modparam, but
without any SQL DB module loaded), the module would report some strange
errors, instead of the more intuitive:

WARNING:core:solve_module_dependencies: module usrloc depends on an
 sqldb module due to modparam working_mode_preset, but none was loaded!
ERROR:core:main: failed to solve module dependencies

Thanks to Vlad Pătrașcu for the catch!

(cherry picked from commit 0b55ca3)
  • Loading branch information
liviuchircu committed Sep 25, 2019
1 parent 23fb41e commit d19bc1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/usrloc/ul_mod.c
Expand Up @@ -300,7 +300,7 @@ static module_dependency_t *get_deps_db_mode(param_export_t *param)

static module_dependency_t *get_deps_wmode_preset(param_export_t *param)
{
char *haystack = (char *)param->param_pointer;
char *haystack = *(char **)param->param_pointer;

if (l_memmem(haystack, "sql-", strlen(haystack), strlen("sql-")))
return alloc_module_dep(MOD_TYPE_SQLDB, NULL, DEP_ABORT);
Expand All @@ -313,7 +313,7 @@ static module_dependency_t *get_deps_wmode_preset(param_export_t *param)

static module_dependency_t *get_deps_rr_persist(param_export_t *param)
{
if (!strcasecmp((char *)param->param_pointer, "load-from-sql"))
if (!strcasecmp(*(char **)param->param_pointer, "load-from-sql"))
return alloc_module_dep(MOD_TYPE_SQLDB, NULL, DEP_ABORT);

return NULL;
Expand Down

0 comments on commit d19bc1b

Please sign in to comment.