From 847177cda88eed885da0b5f0b66b03ffcd06c8f6 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 17 May 2011 11:57:49 -0400 Subject: [PATCH] Fix lttng bug having the wrong sessiond path Executing lttng with uid=0 and not being in the tracing group was setting the wrong default session daemon path in the liblttngctl API. Also adds two debug output for the session daemon. Signed-off-by: David Goulet --- liblttngctl/liblttngctl.c | 2 +- ltt-sessiond/main.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/liblttngctl/liblttngctl.c b/liblttngctl/liblttngctl.c index 38be54774..e400775ea 100644 --- a/liblttngctl/liblttngctl.c +++ b/liblttngctl/liblttngctl.c @@ -431,7 +431,7 @@ static int set_session_daemon_path(void) /* Are we in the tracing group ? */ ret = check_tracing_group(tracing_group); - if (ret < 0) { + if (ret < 0 && getuid() != 0) { if (sprintf(sessiond_sock_path, DEFAULT_HOME_CLIENT_UNIX_SOCK, getenv("HOME")) < 0) { return -ENOMEM; diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index c50bfd88c..de601b6f8 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -1102,6 +1102,9 @@ int main(int argc, char **argv) } } + DBG("Client socket path %s", client_unix_sock_path); + DBG("Application socket path %s", apps_unix_sock_path); + /* See if daemon already exist. If any of the two * socket needed by the daemon are present, this test fails */ -- 2.34.1