Hide lttng_ust_getenv private symbols
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 9 Mar 2021 19:41:26 +0000 (14:41 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Mar 2021 14:39:56 +0000 (09:39 -0500)
The major SONAME bump to '1' gives us the opportunity to hide private
symbols that should never have been visible.

Also namespace lttng_getenv to lttng_ust_getenv to match the init
function.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I03f9c4f431d521a3b2419bde23a51d495155730c

liblttng-ust/getenv.c
liblttng-ust/getenv.h
liblttng-ust/lttng-clock.c
liblttng-ust/lttng-getcpu.c
liblttng-ust/lttng-ust-comm.c
liblttng-ust/lttng-ust-statedump.c
snprintf/core.c

index f2222ddbf5ab13dcf4a780fe09473a825dc96f59..ea8edbcdf5244878f5a7fd4f900068f0502e4fe7 100644 (file)
@@ -50,7 +50,7 @@ int lttng_is_setuid_setgid(void)
        return geteuid() != getuid() || getegid() != getgid();
 }
 
-char *lttng_getenv(const char *name)
+char *lttng_ust_getenv(const char *name)
 {
        size_t i;
        struct lttng_env *e;
index c504ecbdf0dfc3176a623f0fdfb839ea0a08f281..f8e7bc37a631f1531dbf14aed273264d5fd8ba5e 100644 (file)
@@ -7,17 +7,21 @@
 #ifndef _COMPAT_GETENV_H
 #define _COMPAT_GETENV_H
 
+#include "ust-helper.h"
+
 /*
- * Always add the lttng-ust environment variables to lttng_getenv()
- * infrastructure rather than using getenv() directly from lttng-ust.
- * This ensures that we don't trigger races between getenv() invoked by
- * lttng-ust listener threads invoked concurrently with setenv() called
- * by an otherwise single-threaded application thread. (the application
- * is not aware that it runs with lttng-ust)
+ * Always add the lttng-ust environment variables using the lttng_ust_getenv()
+ * infrastructure rather than using getenv() directly.  This ensures that we
+ * don't trigger races between getenv() invoked by lttng-ust listener threads
+ * invoked concurrently with setenv() called by an otherwise single-threaded
+ * application thread. (the application is not aware that it runs with
+ * lttng-ust)
  */
 
-char *lttng_getenv(const char *name);
+LTTNG_HIDDEN
+char *lttng_ust_getenv(const char *name);
 
+LTTNG_HIDDEN
 void lttng_ust_getenv_init(void);
 
 #endif /* _COMPAT_GETENV_H */
index 3cd26fb34f839467eccf4e8d7346611687beafac..93a5075d8a2b0db1693246fa44ac09df298c4ee8 100644 (file)
@@ -90,7 +90,7 @@ void lttng_ust_clock_init(void)
 
        if (clock_handle)
                return;
-       libname = lttng_getenv("LTTNG_UST_CLOCK_PLUGIN");
+       libname = lttng_ust_getenv("LTTNG_UST_CLOCK_PLUGIN");
        if (!libname)
                return;
        clock_handle = dlopen(libname, RTLD_NOW);
index dc2834e9f310bbaa9047ec845197019c4b9b89fe..762f8152fec1aacc157407da1ea2b2566a991379 100644 (file)
@@ -34,7 +34,7 @@ void lttng_ust_getcpu_init(void)
 
        if (getcpu_handle)
                return;
-       libname = lttng_getenv("LTTNG_UST_GETCPU_PLUGIN");
+       libname = lttng_ust_getenv("LTTNG_UST_GETCPU_PLUGIN");
        if (!libname)
                return;
        getcpu_handle = dlopen(libname, RTLD_NOW);
index a269104965e9c8348af7bb4a89c3f65ec6d634a9..25de5dd5535a3f25ee4b15e8d9ac709152bf4cf1 100644 (file)
@@ -398,11 +398,11 @@ const char *get_lttng_home_dir(void)
 {
        const char *val;
 
-       val = (const char *) lttng_getenv("LTTNG_HOME");
+       val = (const char *) lttng_ust_getenv("LTTNG_HOME");
        if (val != NULL) {
                return val;
        }
-       return (const char *) lttng_getenv("HOME");
+       return (const char *) lttng_ust_getenv("HOME");
 }
 
 /*
@@ -552,7 +552,7 @@ long get_timeout(void)
        long constructor_delay_ms = LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS;
 
        if (!got_timeout_env) {
-               str_timeout = lttng_getenv("LTTNG_UST_REGISTER_TIMEOUT");
+               str_timeout = lttng_ust_getenv("LTTNG_UST_REGISTER_TIMEOUT");
                got_timeout_env = 1;
        }
        if (str_timeout)
@@ -619,7 +619,7 @@ static
 void get_allow_blocking(void)
 {
        const char *str_allow_blocking =
-               lttng_getenv("LTTNG_UST_ALLOW_BLOCKING");
+               lttng_ust_getenv("LTTNG_UST_ALLOW_BLOCKING");
 
        if (str_allow_blocking) {
                DBG("%s environment variable is set",
index 2b3158d4e70d15b41055e12bfc03cec0269089df..eac3e888df5ad668982cb20a1826a65482653397 100644 (file)
@@ -548,7 +548,7 @@ void lttng_ust_dl_update(void *ip)
 {
        struct dl_iterate_data data;
 
-       if (lttng_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP"))
+       if (lttng_ust_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP"))
                return;
 
        /*
@@ -582,7 +582,7 @@ void lttng_ust_dl_update(void *ip)
 static
 int do_baddr_statedump(void *owner)
 {
-       if (lttng_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP"))
+       if (lttng_ust_getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP"))
                return 0;
        lttng_ust_dl_update(LTTNG_UST_CALLER_IP());
        ust_dl_table_statedump(owner);
@@ -592,7 +592,7 @@ int do_baddr_statedump(void *owner)
 static
 int do_procname_statedump(void *owner)
 {
-       if (lttng_getenv("LTTNG_UST_WITHOUT_PROCNAME_STATEDUMP"))
+       if (lttng_ust_getenv("LTTNG_UST_WITHOUT_PROCNAME_STATEDUMP"))
                return 0;
 
        trace_statedump_event(procname_cb, owner, lttng_ust_sockinfo_get_procname(owner));
index d0f60a106e6f5d389b8c8a5a93c8a584ce669c79..8c4eddeca1a208f90bc2be16cac9153e3adb82ea 100644 (file)
@@ -14,7 +14,7 @@ void ust_err_init(void)
 
        if (ust_err_loglevel == UST_ERR_LOGLEVEL_UNKNOWN) {
                /*
-                * This getenv is not part of lttng_getenv() because it
+                * This getenv is not part of lttng_ust_getenv() because it
                 * is required to print ERR() performed during getenv
                 * initialization.
                 */
This page took 0.032009 seconds and 4 git commands to generate.