From: Arran Cudbard-Bell Date: Mon, 24 Feb 2020 19:03:34 +0000 (-0500) Subject: Print better error when we can't find the dictionary validation libraries X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f4034edbfdbb45d579d9d621bec632539eaf044;p=thirdparty%2Ffreeradius-server.git Print better error when we can't find the dictionary validation libraries --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index 911b99f9c7f..3c8a6101270 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -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 */ diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 04d7f46f5da..c4d9526fc17 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -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;