]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Show which symbols we're checking for on autoload
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 30 Apr 2018 09:23:53 +0000 (21:23 +1200)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 30 Apr 2018 09:23:53 +0000 (21:23 +1200)
src/main/dl.c

index f1d26b49c2c9812c51d63713359666df35e211e7..cf5588bf09fe6e24c80166f7afa05897cd1ce284 100644 (file)
@@ -293,9 +293,13 @@ static int dl_symbol_init_walk(dl_t const *dl_module)
 
                        MEM(sym_name = talloc_typed_asprintf(NULL, "%s_%s", dl_module->name, init->symbol));
                        sym = dlsym(dl_module->handle, sym_name);
+                       if (!sym) {
+                               DEBUG4("Symbol %s not found", sym_name);
+                               talloc_free(sym_name);
+                               continue;
+                       }
+                       DEBUG3("Symbol %s found at %p", sym_name, sym);
                        talloc_free(sym_name);
-
-                       if (!sym) continue;
                }
 
                if (init->func(dl_module, sym, init->ctx) < 0) return -1;
@@ -683,14 +687,15 @@ dl_t const *dl_module(CONF_SECTION *conf, dl_t const *parent, char const *name,
        if (!dl) dl_init();
 
        if (parent) {
-               to_find.name = module_name = talloc_typed_asprintf(NULL, "%s_%s_%s",
-                                                            fr_int2str(dl_type_prefix, parent->type, "<INVALID>"),
-                                                            parent->common->name, name);
+               module_name = talloc_typed_asprintf(NULL, "%s_%s_%s",
+                                                   fr_int2str(dl_type_prefix, parent->type, "<INVALID>"),
+                                                   parent->common->name, name);
        } else {
-               to_find.name = module_name = talloc_typed_asprintf(NULL, "%s_%s",
-                                                            fr_int2str(dl_type_prefix, type, "<INVALID>"),
-                                                            name);
+               module_name = talloc_typed_asprintf(NULL, "%s_%s",
+                                                   fr_int2str(dl_type_prefix, type, "<INVALID>"),
+                                                   name);
        }
+       to_find.name = module_name;
 
        for (p = module_name, q = p + talloc_array_length(p) - 1; p < q; p++) *p = tolower(*p);