X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=9b1675e8be94b89b560dcd77db1e36e5fedb8775;hp=9612b9a23154f0e9cc0b8e342bb722c5ca019487;hb=567eb353c7f88e2fdaa106eb7e0a38dbb8717792;hpb=d26c59c5718ae2f725287cb5997f2902e095ea31 diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 9612b9a23..9b1675e8b 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -1178,6 +1178,13 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, goto end_channel_error; } + /* + * Assign UST application UID to the channel. This value is ignored for + * per PID buffers. This is specific to UST thus setting this after the + * allocation. + */ + channel->ust_app_uid = msg.u.ask_channel.ust_app_uid; + /* Build channel attributes from received message. */ attr.subbuf_size = msg.u.ask_channel.subbuf_size; attr.num_subbuf = msg.u.ask_channel.num_subbuf; @@ -1859,12 +1866,18 @@ int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx, request.session_id = channel->session_id; request.session_id_per_pid = channel->session_id_per_pid; - request.uid = channel->uid; + /* + * Request the application UID here so the metadata of that application can + * be sent back. The channel UID corresponds to the user UID of the session + * used for the rights on the stream file(s). + */ + request.uid = channel->ust_app_uid; request.key = channel->key; + DBG("Sending metadata request to sessiond, session id %" PRIu64 - ", per-pid %" PRIu64, - channel->session_id, - channel->session_id_per_pid); + ", per-pid %" PRIu64 ", app UID %u and channek key %" PRIu64, + request.session_id, request.session_id_per_pid, request.uid, + request.key); pthread_mutex_lock(&ctx->metadata_socket_lock); ret = lttcomm_send_unix_sock(ctx->consumer_metadata_socket, &request,