From: Jonathan Rajotte Date: Tue, 26 Apr 2022 18:33:52 +0000 (-0400) Subject: lttng-ctl: use the parsed URI instead of raw string for override X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a03abed1f72fe09b9a97031484b1b48e8eae316c;p=lttng-tools.git lttng-ctl: use the parsed URI instead of raw string for override Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I0439c1ecdc935011036e3772e59f0caba017de34 --- diff --git a/src/lib/lttng-ctl/load.cpp b/src/lib/lttng-ctl/load.cpp index 02e2a6ff9..eaab9905e 100644 --- a/src/lib/lttng-ctl/load.cpp +++ b/src/lib/lttng-ctl/load.cpp @@ -485,7 +485,7 @@ int lttng_load_session_attr_set_override_url( goto end; } - path_str = lttng_strndup(raw_path_str, PATH_MAX); + path_str = lttng_strndup(uri[0].dst.path, PATH_MAX); if (!path_str) { ret = -LTTNG_ERR_NOMEM; goto end; diff --git a/tests/regression/tools/save-load/test_load b/tests/regression/tools/save-load/test_load index f149acd08..e073e6071 100755 --- a/tests/regression/tools/save-load/test_load +++ b/tests/regression/tools/save-load/test_load @@ -168,7 +168,7 @@ function test_override_url_normal() { local local_url_override="file:///tmp/override/to/here" local local_path_override="/tmp/override/to/here" - local local_path_compare_value="/tmp/override/to/here/" + local local_path_compare_value="/tmp/override/to/here" local stream_url_override="net://127.0.0.1:8172:9817" local stream_url_compare="tcp4://127.0.0.1:8172/ [data: 9817]" @@ -216,7 +216,7 @@ function test_override_url_snapshot() { local url_override="file:///tmp/override/to/here" local path_override="/tmp/override/to/here" - local path_compare_value="/tmp/override/to/here/" + local path_compare_value="/tmp/override/to/here" local stream_url_override="net://127.0.0.1:8172:9817" local stream_url_compare_ctrl="tcp4://127.0.0.1:8172/" local stream_url_compare_data="tcp4://127.0.0.1:9817/" @@ -271,7 +271,7 @@ function test_override_url_live() { local url_override="file:///tmp/override/to/here" local path_override="/tmp/override/to/here" - local path_compare_value="/tmp/override/to/here/" + local path_compare_value="/tmp/override/to/here" local stream_url_override="net://127.0.0.1:8172:9817" local stream_url_compare="tcp4://127.0.0.1:8172/ [data: 9817]" local local_session_name="${SESSION_NAME}-live"