From: David Goulet Date: Tue, 17 May 2011 15:57:49 +0000 (-0400) Subject: Fix lttng bug having the wrong sessiond path X-Git-Tag: v2.0-pre1~136 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=847177cda88eed885da0b5f0b66b03ffcd06c8f6;ds=sidebyside 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 --- 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 */