]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move lowercase to caller
authorAlan T. DeKok <aland@freeradius.org>
Mon, 4 Nov 2019 22:01:00 +0000 (17:01 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 4 Nov 2019 22:01:00 +0000 (17:01 -0500)
src/lib/util/dict_util.c
src/lib/util/dl.c

index 4296bcfc5e55aedd27f4bfd3af4e44ec56d0834d..4359496f9e9b38d6e4928ee74a3e9cbb753278ea 100644 (file)
@@ -2156,10 +2156,12 @@ fr_dict_enum_t *fr_dict_enum_by_alias(fr_dict_attr_t const *da, char const *alia
 static int dict_dlopen(fr_dict_t *dict, char const *name)
 {
        char *module_name;
+       char *p, *q;
 
        if (!name) return 0;
 
        module_name = talloc_typed_asprintf(NULL, "libfreeradius-%s", name);
+       for (p = module_name, q = p + talloc_array_length(p) - 1; p < q; p++) *p = tolower(*p);
 
        /*
         *      Pass in dict as the uctx so that we can get at it in
index bc9e4be2f0ea3441877755b19148b50f1f945cc9..71676ecf789084acf2cf05c901c6afc08af40d50 100644 (file)
@@ -232,8 +232,12 @@ int dl_symbol_init(dl_loader_t *dl_loader, dl_t const *dl)
 
                        snprintf(buffer, sizeof(buffer), "%s_%s", dl->name, init->symbol);
 
+                       /*
+                        *      '-' is not a valid symbol character in
+                        *      C.  But "libfreeradius-radius" is a
+                        *      valid library name.  So we hash things together.
+                        */
                        for (p = buffer; *p != '\0'; p++) {
-                               if (isupper((int) *p)) *p = tolower((int) *p);
                                if (*p == '-') *p = '_';
                        }