From: Jérémie Galarneau Date: Sun, 12 Nov 2017 19:19:01 +0000 (-0500) Subject: Fix: create lttng run dir regardless of user privilege X-Git-Tag: v2.11.0-rc1~445 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b723c447e99a0aa57fd3d5313273c05bb416a517;p=lttng-tools.git Fix: create lttng run dir regardless of user privilege The changes made when centralizing the configuration handling introduced a regression which cause the rundir to only be created when running as the root user. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 10802aa7b..76d087a1e 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -5584,12 +5584,13 @@ int main(int argc, char **argv) /* Check if daemon is UID = 0 */ is_root = !getuid(); + if (create_lttng_rundir()) { + retval = -1; + goto exit_init_data; + } + if (is_root) { /* Create global run dir with root access */ - if (create_lttng_rundir()) { - retval = -1; - goto exit_init_data; - } kernel_channel_monitor_pipe = lttng_pipe_open(0); if (!kernel_channel_monitor_pipe) {