Skip to content

Commit

Permalink
if it's a group it has to be unlang_group_t
Browse files Browse the repository at this point in the history
And also CS may exist, but have nothing in it.
  • Loading branch information
alandekok committed Sep 22, 2016
1 parent b40edfd commit 54ba47a
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/main/interpreter.c
Expand Up @@ -1167,13 +1167,16 @@ static rlm_rcode_t unlang_run(REQUEST *request, unlang_stack_t *stack)
goto do_pop;
}

static unlang_t empty_group = {
.type = UNLANG_TYPE_GROUP,
.debug_name = "empty-group",
.actions = { MOD_ACTION_RETURN, MOD_ACTION_RETURN, MOD_ACTION_RETURN, MOD_ACTION_RETURN,
MOD_ACTION_RETURN, MOD_ACTION_RETURN, MOD_ACTION_RETURN, MOD_ACTION_RETURN,
MOD_ACTION_RETURN
static unlang_group_t empty_group = {
.self = {
.type = UNLANG_TYPE_GROUP,
.debug_name = "empty-group",
.actions = { MOD_ACTION_RETURN, MOD_ACTION_RETURN, MOD_ACTION_RETURN, MOD_ACTION_RETURN,
MOD_ACTION_RETURN, MOD_ACTION_RETURN, MOD_ACTION_RETURN, MOD_ACTION_RETURN,
MOD_ACTION_RETURN
},
},
.group_type = UNLANG_GROUP_TYPE_SIMPLE,
};

/** Push a configuration section onto the request stack for later interpretation.
Expand All @@ -1188,12 +1191,10 @@ void unlang_push_section(REQUEST *request, CONF_SECTION *cs, rlm_rcode_t action)
* Interpretable unlang instructions are stored as CONF_DATA
* associated with sections.
*/
if (cs) {
instruction = cf_data_find(cs, "unlang");
rad_assert(instruction != NULL);
} else {
instruction = &empty_group;
}
if (cs) instruction = cf_data_find(cs, "unlang");

if (!instruction) instruction = unlang_group_to_generic(&empty_group);

unlang_push(stack, instruction, action, true);

RDEBUG4("** [%i] %s - substack begins", stack->depth, __FUNCTION__);
Expand Down

0 comments on commit 54ba47a

Please sign in to comment.