]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Rename lt_* to fr_*. Fixes #1277
authorAlan T. DeKok <aland@freeradius.org>
Thu, 3 Nov 2016 13:50:56 +0000 (09:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 3 Nov 2016 13:51:50 +0000 (09:51 -0400)
Which fixes linker issues in libraries which link to libtool,
and then sometimes get the wrong function.

Changed via:

perl -p -i -e 's/lt_dlhandle/fr_dlhandle/g;s/lt_dlopenext/fr_dlopenext/g;s/lt_dlsym/fr_dlsym/g;s/lt_dlclose/fr_dlclose/g;s/lt_dlerror/fr_dlerror/g;' $(find . -name "*.[ch]" -print)

src/include/modpriv.h
src/main/listen.c
src/main/modules.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_eap/eap.c
src/modules/rlm_eap/rlm_eap.h
src/modules/rlm_sql/rlm_sql.c

index d5e2c2392bac5f7aa5ea74eccba53bd9861ab328..f69b47c35bd1aab0fbe590d792a186a1f06a530e 100644 (file)
 extern "C" {
 #endif
 
-typedef void *lt_dlhandle;
+typedef void *fr_dlhandle;
 
-lt_dlhandle lt_dlopenext(char const *name);
-void *lt_dlsym(lt_dlhandle handle, char const *symbol);
-int lt_dlclose(lt_dlhandle handle);
-char const *lt_dlerror(void);
+fr_dlhandle fr_dlopenext(char const *name);
+void *fr_dlsym(fr_dlhandle handle, char const *symbol);
+int fr_dlclose(fr_dlhandle handle);
+char const *fr_dlerror(void);
 
 /*
  *     Keep track of which modules we've loaded.
@@ -31,7 +31,7 @@ char const *lt_dlerror(void);
 typedef struct module_entry_t {
        char                    name[MAX_STRING_LEN];
        module_t const          *module;
-       lt_dlhandle             handle;
+       fr_dlhandle             handle;
 } module_entry_t;
 
 typedef struct fr_module_hup_t fr_module_hup_t;
index e143a1dc16df30cc5e1d9e23393149c5db55bf21..b277c6bc1f08b391aa71b60efcf974d0812793e2 100644 (file)
@@ -2920,7 +2920,7 @@ static const FR_NAME_NUMBER listen_compare[] = {
        { NULL, 0 },
 };
 
-static int _free_proto_handle(lt_dlhandle *handle)
+static int _free_proto_handle(fr_dlhandle *handle)
 {
        dlclose(*handle);
        return 0;
@@ -2933,7 +2933,7 @@ static rad_listen_t *listen_parse(CONF_SECTION *cs, char const *server)
        rad_listen_t    *this;
        CONF_PAIR       *cp;
        char const      *value;
-       lt_dlhandle     handle;
+       fr_dlhandle     handle;
        CONF_SECTION    *server_cs;
        char            buffer[32];
 
@@ -2952,10 +2952,10 @@ static rad_listen_t *listen_parse(CONF_SECTION *cs, char const *server)
        }
 
        snprintf(buffer, sizeof(buffer), "proto_%s", value);
-       handle = lt_dlopenext(buffer);
+       handle = fr_dlopenext(buffer);
        if (handle) {
                fr_protocol_t   *proto;
-               lt_dlhandle     *marker;
+               fr_dlhandle     *marker;
 
                proto = dlsym(handle, buffer);
                if (!proto) {
@@ -2974,7 +2974,7 @@ static rad_listen_t *listen_parse(CONF_SECTION *cs, char const *server)
                /*
                 *      Ensure handle gets closed if config section gets freed
                 */
-               marker = talloc(cs, lt_dlhandle);
+               marker = talloc(cs, fr_dlhandle);
                *marker = handle;
                talloc_set_destructor(marker, _free_proto_handle);
 
index 885cbee2140cc6823f804b6cf8e1719447f154a3..91218dd5fa03e69107fcb6cc679b639f9a79d6fa 100644 (file)
@@ -155,7 +155,7 @@ static int check_module_magic(CONF_SECTION *cs, module_t const *module)
        return 0;
 }
 
-lt_dlhandle lt_dlopenext(char const *name)
+fr_dlhandle fr_dlopenext(char const *name)
 {
        int             flags = RTLD_NOW;
        void            *handle;
@@ -273,19 +273,19 @@ lt_dlhandle lt_dlopenext(char const *name)
        return handle;
 }
 
-void *lt_dlsym(lt_dlhandle handle, char const *symbol)
+void *fr_dlsym(fr_dlhandle handle, char const *symbol)
 {
        return dlsym(handle, symbol);
 }
 
-int lt_dlclose(lt_dlhandle handle)
+int fr_dlclose(fr_dlhandle handle)
 {
        if (!handle) return 0;
 
        return dlclose(handle);
 }
 
-char const *lt_dlerror(void)
+char const *fr_dlerror(void)
 {
        return dlerror();
 }
@@ -516,7 +516,7 @@ static module_entry_t *module_dlopen(CONF_SECTION *cs, char const *module_name)
        /*
         *      Keep the handle around so we can dlclose() it.
         */
-       handle = lt_dlopenext(module_name);
+       handle = fr_dlopenext(module_name);
        if (!handle) {
                cf_log_err_cs(cs, "Failed to link to module '%s': %s", module_name, fr_strerror());
                return NULL;
index 76ba6a442b8ec344721650f2ec7eb8f1ca5a7957..248de8bf9b7de8faa736192a20839120533697bb 100644 (file)
@@ -712,7 +712,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
        /*
         *      Load the appropriate driver for our database
         */
-       inst->handle = lt_dlopenext(inst->driver_name);
+       inst->handle = fr_dlopenext(inst->driver_name);
        if (!inst->handle) {
                cf_log_err_cs(conf, "Could not link driver %s: %s", inst->driver_name, dlerror());
                cf_log_err_cs(conf, "Make sure it (and all its dependent libraries!) are in the search path"
index d9660ed4234eb7a338e73562d938e99e3ab31275..b03654fed8148d9d3933496fa4e99a9f6fc0a1e7 100644 (file)
@@ -125,7 +125,7 @@ int eap_module_instantiate(rlm_eap_t *inst, eap_module_t **m_inst, eap_type_t nu
        /*
         *      Link the loaded EAP-Type
         */
-       method->handle = lt_dlopenext(mod_name);
+       method->handle = fr_dlopenext(mod_name);
        if (!method->handle) {
                ERROR("rlm_eap (%s): Failed to link %s: %s", inst->xlat_name, mod_name, fr_strerror());
 
index 0edf462bd83bf6cbdc45a334741e4179edfa596c..384f7f78d79f1c20a186e6b0512e00affec77f21 100644 (file)
@@ -36,7 +36,7 @@ RCSIDH(rlm_eap_h, "$Id$")
 typedef struct eap_module {
        char const              *name;
        rlm_eap_module_t        *type;
-       lt_dlhandle             handle;
+       fr_dlhandle             handle;
        CONF_SECTION            *cs;
        void                    *instance;
 } eap_module_t;
index 9f2272c18984e69188698ab60b6af7ea8f48a7e6..354d096befe99a4b9a636450cc7068b06035fbd4 100644 (file)
@@ -851,7 +851,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
         *
         *      We need this to check if the sql_fields callback is provided.
         */
-       inst->handle = lt_dlopenext(inst->config->sql_driver_name);
+       inst->handle = fr_dlopenext(inst->config->sql_driver_name);
        if (!inst->handle) {
                ERROR("Could not link driver %s: %s", inst->config->sql_driver_name, fr_strerror());
                ERROR("Make sure it (and all its dependent libraries!) are in the search path of your system's ld");