Use AUTZ rules for AUTH groups. Fixes #425
authorAlan T. DeKok <aland@freeradius.org>
Fri, 6 Sep 2013 14:05:57 +0000 (10:05 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 6 Sep 2013 14:05:57 +0000 (10:05 -0400)
src/main/modcall.c
src/main/modules.c

index c7e1e11..95e817c 100644 (file)
@@ -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];
                }
        }
 
index 145d984..d2cb1cb 100644 (file)
@@ -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;
        }