Fix: race between lttng-ust getenv() and application setenv()
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 38e66dc25926d64407d6fb48013849fc331c1198..61d5d2d87ad14df1cbd96fe813c6b782d680f9fe 100644 (file)
@@ -356,11 +356,11 @@ const char *get_lttng_home_dir(void)
 {
        const char *val;
 
-       val = (const char *) lttng_secure_getenv("LTTNG_HOME");
+       val = (const char *) lttng_getenv("LTTNG_HOME");
        if (val != NULL) {
                return val;
        }
-       return (const char *) lttng_secure_getenv("HOME");
+       return (const char *) lttng_getenv("HOME");
 }
 
 /*
@@ -460,7 +460,7 @@ long get_timeout(void)
        long constructor_delay_ms = LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS;
 
        if (!got_timeout_env) {
-               str_timeout = getenv("LTTNG_UST_REGISTER_TIMEOUT");
+               str_timeout = lttng_getenv("LTTNG_UST_REGISTER_TIMEOUT");
                got_timeout_env = 1;
        }
        if (str_timeout)
@@ -1597,6 +1597,7 @@ void __attribute__((constructor)) lttng_ust_init(void)
         * sessiond before the init functions are completed).
         */
        init_usterr();
+       lttng_ust_getenv_init();        /* Needs init_usterr() to be completed. */
        init_tracepoint();
        lttng_ust_clock_init();
        lttng_ust_getcpu_init();
This page took 0.023773 seconds and 4 git commands to generate.