From 308df7bb0aad1ee6273c99480445a2d4af81e47a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 11 Dec 2018 22:27:20 -0500 Subject: [PATCH] Fix: set client socket permissions after launch of client thread MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The client thread is now the owner of the client socket. As the client socket is now created by the client thread, the socket's permissions must be set after the launch of the client thread. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 7f66a7271..c45280d11 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -1626,12 +1626,6 @@ int main(int argc, char **argv) goto stop_threads; } - /* Set credentials to socket */ - if (is_root && set_permissions(config.rundir.value)) { - retval = -1; - goto stop_threads; - } - /* Get parent pid if -S, --sig-parent is specified. */ if (config.sig_parent) { ppid = getppid(); @@ -1741,6 +1735,12 @@ int main(int argc, char **argv) goto stop_threads; } + /* Set credentials of the client socket and rundir */ + if (is_root && set_permissions(config.rundir.value)) { + retval = -1; + goto stop_threads; + } + if (!launch_ust_dispatch_thread(&ust_cmd_queue, apps_cmd_pipe[1], apps_cmd_notify_pipe[1])) { retval = -1; -- 2.34.1