Call cf_section_parse_pass2() after loading all of the modules
authorAlan T. DeKok <aland@freeradius.org>
Mon, 22 Sep 2014 22:18:45 +0000 (18:18 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 22 Sep 2014 22:18:45 +0000 (18:18 -0400)
src/main/modules.c

index ce7d570..f82773f 100644 (file)
@@ -1428,6 +1428,20 @@ static int pass2_cb(UNUSED void *ctx, void *data)
        return 0;
 }
 
+static int pass2_instance_cb(UNUSED void *ctx, void *data)
+{
+       module_instance_t *node = data;
+
+       if (!node->entry->module->config || !node->cs) return 0;
+
+       if (cf_section_parse_pass2(node->cs, node->insthandle,
+                                  node->entry->module->config) < 0) {
+               return -1;
+       }
+
+       return 0;
+}
+
 /*
  *     Load all of the virtual servers.
  */
@@ -1495,6 +1509,14 @@ int virtual_servers_load(CONF_SECTION *config)
        }
 
        /*
+        *      Check all of the module config items which are xlat expanded.
+        */
+       if (rbtree_walk(instance_tree, RBTREE_IN_ORDER,
+                       pass2_instance_cb, NULL) != 0) {
+               return -1;
+       }
+
+       /*
         *      Now that we've loaded everything, run pass 2 over the
         *      conditions and xlats.
         */