Skip to content

Commit

Permalink
-c and -C binary args: Properly validate module dependencies
Browse files Browse the repository at this point in the history
Along with script syntax validation, the "-c" and "-C" binary arguments should
also ensure all necessary modules are loaded.

Reported by Maxim Sobolev
Fixes #616

(cherry picked from commit 82c3fd6)
  • Loading branch information
liviuchircu committed Aug 25, 2015
1 parent d049947 commit 4012f50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 6 additions & 0 deletions main.c
Expand Up @@ -1033,6 +1033,12 @@ int main(int argc, char** argv)
LM_ERR("bad function call in config file\n");
return ret;
}

if (solve_module_dependencies(modules) != 0) {
LM_ERR("failed to solve module dependencies\n");
return -1;
}

#ifdef EXTRA_DEBUG
print_rl();
#endif
Expand Down
5 changes: 0 additions & 5 deletions sr_module.c
Expand Up @@ -673,11 +673,6 @@ int init_modules(void)
{
int ret;

if (solve_module_dependencies(modules) != 0) {
LM_ERR("failed to solve module dependencies\n");
return -1;
}

ret = init_mod(modules, 0);

free_module_dependencies(modules);
Expand Down

0 comments on commit 4012f50

Please sign in to comment.