Skip to content

Commit

Permalink
Fix the '$module.$method1.$method2' match. #270
Browse files Browse the repository at this point in the history
  • Loading branch information
jpereira committed May 21, 2019
1 parent e172db2 commit 19f9956
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib/server/module.c
Expand Up @@ -719,6 +719,8 @@ module_instance_t *module_by_name_and_method(module_method_t *method, rlm_compon

if (method) *method = NULL;

*name1 = *name2 = NULL;

/*
* Module names are allowed to contain '.'
* so we search for the bare module name first.
Expand Down Expand Up @@ -958,6 +960,10 @@ module_instance_t *module_by_name_and_method(module_method_t *method, rlm_compon
if (!q) {
for (j = 0; mi->module->method_names[j].name1 != NULL; j++) {
methods = &mi->module->method_names[j];
/*
* If we do not have the second $method, then ignore it!
*/
if (methods->name2 != CF_IDENT_ANY) continue;

/*
* Wildcard match name1, we're
Expand Down Expand Up @@ -998,6 +1004,11 @@ module_instance_t *module_by_name_and_method(module_method_t *method, rlm_compon

len = q - p;

/*
* Trim the '.'.
*/
if (*q == '.' && *(q + 1)) q++;

/*
* We have "module.METHOD1.METHOD2".
*
Expand Down

0 comments on commit 19f9956

Please sign in to comment.