X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=liblttng-ustconsumer%2Flttng-ustconsumer.c;fp=liblttng-ustconsumer%2Flttng-ustconsumer.c;h=efb6be42490812d45f911b7f650254264efdc57f;hp=89dbefa361380ad2c317bf161a6d65cc7baae0e5;hb=6df2e2c977b698cc6b8f15c90b649516674028f9;hpb=a991f516ac2783c833ebbc6ac0ac3c0e4ca71371 diff --git a/liblttng-ustconsumer/lttng-ustconsumer.c b/liblttng-ustconsumer/lttng-ustconsumer.c index 89dbefa36..efb6be424 100644 --- a/liblttng-ustconsumer/lttng-ustconsumer.c +++ b/liblttng-ustconsumer/lttng-ustconsumer.c @@ -215,7 +215,9 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, msg.u.stream.state, msg.u.stream.mmap_len, msg.u.stream.output, - msg.u.stream.path_name); + msg.u.stream.path_name, + msg.u.stream.uid, + msg.u.stream.gid); if (new_stream == NULL) { lttng_consumer_send_error(ctx, CONSUMERD_OUTFD_ERROR); goto end; @@ -403,6 +405,11 @@ int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream) goto error; } stream->out_fd = ret; + ret = chown(stream->path_name, stream->uid, stream->gid); + if (ret < 0) { + ERR("Changing ownership of %s", stream->path_name); + perror("chown"); + } } /* we return 0 to let the library handle the FD internally */