From: Simon Marchi Date: Wed, 2 Dec 2020 22:36:05 +0000 (-0500) Subject: Fix: sink.ctf.fs: fix logic of make_unique_stream_file_name X-Git-Tag: v2.0.4~12 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;ds=sidebyside;h=1e03d33b36559cd925774ea25c627cefd43ce9ba;hp=1e03d33b36559cd925774ea25c627cefd43ce9ba;p=babeltrace.git Fix: sink.ctf.fs: fix logic of make_unique_stream_file_name The logic in make_unique_stream_file_name is wrong. It tries names as long as the candidate exists _and_ is named "metadata". The intent here is that we keep trying names as long as the candidate name names an already existing file _or_ is named "metadata". So the && should be a ||. The impact of this bug is that if two streams have the same name, they'll write to the same file, with troubling consequences (see bug 1279 [1]). Add a test where `sink.ctf.fs` writes a trace with two streams with the same name, and one stream named "metadata". [1] https://bugs.lttng.org/issues/1279 Change-Id: Ifaa30459574229aa5e607095f65033d2caae188f Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/4483 Tested-by: jenkins Reviewed-by: Philippe Proulx Reviewed-on: https://review.lttng.org/c/babeltrace/+/4492 ---