]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set request->server_cs if not already set
authorAlan T. DeKok <aland@freeradius.org>
Tue, 24 May 2016 21:57:14 +0000 (17:57 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 24 May 2016 21:57:14 +0000 (17:57 -0400)
src/main/modules.c

index e4272820468ab13acf1887ae6380f888a0b7d323..9d046bc04f4e7bd396ae27e90421fc42aa2b4feb 100644 (file)
@@ -1835,7 +1835,16 @@ static rlm_rcode_t indexed_modcall(rlm_components_t comp, int idx, REQUEST *requ
        char const *module;
        char const *component;
 
-       rad_assert(request->server_cs != NULL);
+       /*
+        *      Some modules don't (yet) set this.  It's also
+        *      debatable as to whether they should be required to set
+        *      it.
+        */
+       if (!request->server_cs) {
+               rad_assert(request->server != NULL);
+
+               request->server_cs = cf_section_sub_find_name2(main_config.config, "server", request->server);
+       }
 
        cs = cf_section_sub_find(request->server_cs, section_type_value[comp].section);
        if (!cs) {