Cleanup: don't spawn per-user thread if HOME is not set
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 30 Oct 2012 01:39:42 +0000 (21:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 30 Oct 2012 01:39:42 +0000 (21:39 -0400)
Reported-by: David OShea <David.OShea@quantum.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-comm.c

index 31955bb56d82b94a94a0d99886244353036a8f0a..59b9a98f4d74647b3cab1871148eeb451104a926 100644 (file)
@@ -157,14 +157,16 @@ int setup_local_apps(void)
         * Disallow per-user tracing for setuid binaries.
         */
        if (uid != geteuid()) {
-               local_apps.allowed = 0;
+               assert(local_apps.allowed == 0);
                return 0;
-       } else {
-               local_apps.allowed = 1;
        }
        home_dir = (const char *) getenv("HOME");
-       if (!home_dir)
+       if (!home_dir) {
+               WARN("HOME environment variable not set. Disabling LTTng-UST per-user tracing.");
+               assert(local_apps.allowed == 0);
                return -ENOENT;
+       }
+       local_apps.allowed = 1;
        snprintf(local_apps.sock_path, PATH_MAX,
                 DEFAULT_HOME_APPS_UNIX_SOCK, home_dir);
        snprintf(local_apps.wait_shm_path, PATH_MAX,
@@ -973,7 +975,7 @@ void __attribute__((constructor)) lttng_ust_init(void)
 
        ret = setup_local_apps();
        if (ret) {
-               ERR("Error setting up to local apps");
+               DBG("local apps setup returned %d", ret);
        }
 
        /* A new thread created by pthread_create inherits the signal mask
This page took 0.026215 seconds and 4 git commands to generate.