]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
better error messages. Fixes #4204
authorAlan T. DeKok <aland@freeradius.org>
Wed, 25 Aug 2021 12:54:42 +0000 (08:54 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 25 Aug 2021 12:56:43 +0000 (08:56 -0400)
src/lib/unlang/compile.c

index d8de6d43250451cb3b496ddd187a39ee2886a8bb..44388342c5027b783826b7fcbadae31618d16d96 100644 (file)
@@ -3685,6 +3685,18 @@ check_for_module:
        if (realname != name) {
                cf_log_warn(ci, "Ignoring \"%s\" as the \"%s\" module is not enabled.", name, realname);
                return UNLANG_IGNORE;
+
+       }
+
+       /*
+        *      The module exists, but it does not have the
+        *      named method.
+        */
+       if (!unlang_ctx2.section_name1) {
+               cf_log_err(ci, "The '%s' module does not have a '%s %s' method.",
+                          name, unlang_ctx->section_name1,
+                          unlang_ctx->section_name2 ? unlang_ctx->section_name2 : "");
+               return NULL;
        }
 
        /*