]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Tweak to process virtual server sections before calling the instantiate function
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 12 May 2024 16:53:36 +0000 (10:53 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 12 May 2024 17:13:39 +0000 (11:13 -0600)
src/lib/server/virtual_servers.c

index 97b3cc1864985c823fe3e3c9381b1223623f36f7..3f8d3f44228ec97dd62f896fbcc0580412459d48 100644 (file)
@@ -1465,18 +1465,11 @@ int virtual_servers_instantiate(void)
 
                fr_assert(virtual_servers[i]->process_mi);
 
-               /*
-                *      Complete final instantiation of the process module
-                */
-               if (module_instantiate(virtual_servers[i]->process_mi) < 0) {
-                       cf_log_perr(virtual_servers[i]->process_mi->conf,
-                                   "Failed instantiating process module");
-                       return -1;
-               }
-
                /*
                 *      Compile the processing sections indicated by
-                *      the process module.
+                *      the process module.  This must be done before
+                *      module_instantiate is called, as the instance
+                *      data is protected after this call.
                 */
                if (process->compile_list) {
                        tmpl_rules_t            parse_rules = {
@@ -1494,6 +1487,15 @@ int virtual_servers_instantiate(void)
                        }
                }
 
+               /*
+                *      Complete final instantiation of the process module
+                */
+               if (module_instantiate(virtual_servers[i]->process_mi) < 0) {
+                       cf_log_perr(virtual_servers[i]->process_mi->conf,
+                                   "Failed instantiating process module");
+                       return -1;
+               }
+
                /*
                 *      Print out warnings for unused "recv" and
                 *      "send" sections.