From d57ce27f07552367d01210ff8b9f48fa88c11ea3 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Fri, 6 Sep 2013 10:05:57 -0400 Subject: [PATCH] Use AUTZ rules for AUTH groups. Fixes #425 --- src/main/modcall.c | 13 +++---------- src/main/modules.c | 7 ++++++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/modcall.c b/src/main/modcall.c index c7e1e11184..95e817c00e 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -2106,12 +2106,9 @@ static modcallable *do_compile_modsingle(modcallable *parent, csingle = mod_singletocallable(single); csingle->parent = parent; csingle->next = NULL; - if (!parent || (component != RLM_COMPONENT_AUTH)) { + if (!parent) { memcpy(csingle->actions, defaultactions[component][grouptype], sizeof csingle->actions); - } else { /* inside Auth-Type has different rules */ - memcpy(csingle->actions, defaultactions[RLM_COMPONENT_AUTZ][grouptype], - sizeof csingle->actions); } rad_assert(modrefname != NULL); csingle->name = modrefname; @@ -2300,12 +2297,8 @@ set_codes: * set. */ for (i = 0; i < RLM_MODULE_NUMCODES; i++) { - if (!c->actions[i]) { - if (!parent || (component != RLM_COMPONENT_AUTH)) { - c->actions[i] = defaultactions[component][parentgrouptype][i]; - } else { /* inside Auth-Type has different rules */ - c->actions[i] = defaultactions[RLM_COMPONENT_AUTZ][parentgrouptype][i]; - } + if (!c->actions[i] && !parent) { + c->actions[i] = defaultactions[component][parentgrouptype][i]; } } diff --git a/src/main/modules.c b/src/main/modules.c index 145d9845de..d2cb1cbf15 100644 --- a/src/main/modules.c +++ b/src/main/modules.c @@ -780,7 +780,12 @@ static int load_subcomponent_section(modcallable *parent, CONF_SECTION *cs, /* * Compile the group. */ - ml = compile_modgroup(parent, comp, cs); + if (comp != RLM_COMPONENT_AUTH) { + ml = compile_modgroup(parent, comp, cs); + } else { + ml = compile_modgroup(parent, RLM_COMPONENT_AUTZ, cs); + DEBUG("COMPILE Auth-Type %s", cf_section_name2(cs)); + } if (!ml) { return 0; } -- 2.47.3