Fix: relayd: create_index_file error handling
[lttng-tools.git] / src / bin / lttng-sessiond / ust-consumer.c
index c39a87fba7895da17d663bee882c85c480e7f4d3..f9a29e49ecd2625f8e6503a8a66a812d1bb72957 100644 (file)
@@ -62,19 +62,19 @@ static char *setup_channel_trace_path(struct consumer_output *consumer,
        }
 
        /* Get correct path name destination */
-       if (consumer->type == CONSUMER_DST_LOCAL) {
-               /* Set application path to the destination path */
-               ret = snprintf(pathname, LTTNG_PATH_MAX, "%s%s",
-                               consumer->domain_subdir, ua_sess->path);
-               DBG3("Userspace local consumer trace path relative to current trace chunk: \"%s\"",
-                               pathname);
-       } else {
+       if (consumer->type == CONSUMER_DST_NET &&
+                       consumer->relay_major_version == 2 &&
+                       consumer->relay_minor_version < 11) {
                ret = snprintf(pathname, LTTNG_PATH_MAX, "%s%s/%s%s",
                                consumer->dst.net.base_dir,
-                               consumer->chunk_path,
-                               consumer->domain_subdir,
+                               consumer->chunk_path, consumer->domain_subdir,
                                ua_sess->path);
+       } else {
+               ret = snprintf(pathname, LTTNG_PATH_MAX, "%s%s",
+                               consumer->domain_subdir, ua_sess->path);
        }
+       DBG3("Userspace consumer trace path relative to current trace chunk: \"%s\"",
+                       pathname);
        if (ret < 0) {
                PERROR("Failed to format channel path");
                goto error;
@@ -85,7 +85,6 @@ static char *setup_channel_trace_path(struct consumer_output *consumer,
        }
 
        return pathname;
-
 error:
        free(pathname);
        return NULL;
@@ -214,10 +213,11 @@ static int ask_channel_creation(struct ust_app_session *ua_sess,
                        ua_chan->tracefile_count,
                        ua_sess->id,
                        ua_sess->output_traces,
-                       ua_sess->uid,
+                       ua_sess->real_credentials.uid,
                        ua_chan->attr.blocking_timeout,
                        root_shm_path, shm_path,
-                       trace_chunk);
+                       trace_chunk,
+                       &ua_sess->effective_credentials);
 
        health_code_update();
 
This page took 0.023913 seconds and 4 git commands to generate.