Skip to content

Commit

Permalink
rlm_sql should return noop if we can't find a matching query section
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 5, 2015
1 parent 0fc782a commit fc294bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/main/conffile.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ CONF_ITEM *cf_reference_item(CONF_SECTION const *parentcs,
}

no_such_item:
WARN("No such configuration item %s", ptr);
return NULL;
}

Expand Down
12 changes: 8 additions & 4 deletions src/modules/rlm_sql/rlm_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,16 +1308,20 @@ static int acct_redundant(rlm_sql_t *inst, REQUEST *request, sql_acct_section_t
goto finish;
}

/*
* If we can't find a matching config item we do
* nothing so return RLM_MODULE_NOOP.
*/
item = cf_reference_item(NULL, section->cs, path);
if (!item) {
rcode = RLM_MODULE_FAIL;
RWDEBUG("No such item %s", path);
rcode = RLM_MODULE_NOOP;

goto finish;
}

if (cf_item_is_section(item)){
REDEBUG("Sections are not supported as references");
rcode = RLM_MODULE_FAIL;
RWDEBUG("Sections are not supported as references");
rcode = RLM_MODULE_NOOP;

goto finish;
}
Expand Down

0 comments on commit fc294bc

Please sign in to comment.