]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Print better error when we can't find the dictionary validation libraries
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 24 Feb 2020 19:03:34 +0000 (14:03 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 24 Feb 2020 19:03:34 +0000 (14:03 -0500)
src/lib/util/dict_tokenize.c
src/lib/util/dict_util.c

index 911b99f9c7ffc2f0d3a031e4e12eace4fa6d9c67..3c8a6101270c301a5921ad68283cff558c8bbd46 100644 (file)
@@ -1331,17 +1331,12 @@ post_option:
         *      Some protocols don't need them, so it's OK if the
         *      validation routines don't exist.
         */
-       if (dict_dlopen(dict, argv[0]) < 0) {
+       if (require_dl && (dict_dlopen(dict, argv[0]) < 0)) {
        error:
                talloc_free(dict);
                return -1;
        }
 
-       if (require_dl && !dict->dl) {
-               fr_strerror_printf("Failed to find libfreeradius-%s", argv[0]);
-               goto error;
-       }
-
        /*
         *      Set the root attribute with the protocol name
         */
index 04d7f46f5da27390eff532a063d059e39f11cb2d..c4d9526fc172b8202507406284406f31589f2341 100644 (file)
@@ -2187,6 +2187,10 @@ int dict_dlopen(fr_dict_t *dict, char const *name)
         *      a soft error if they don't exist.
         */
        dict->dl = dl_by_name(dict_gctx->dict_loader, module_name, dict, false);
+       if (!dict->dl) {
+               fr_strerror_printf_push("Failed loading dictionary validation library");
+               return -1;
+       }
 
        talloc_free(module_name);
        return 0;