From aacbfa47ad16d5778726b678c095b824d75d388b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 13 Sep 2018 18:43:28 -0400 Subject: [PATCH] Fix: expand load path to an absolute path before daemonizing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Relative paths must be expanded before the sessiond is daemonized as the CWD is then changed to '/'. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 125a18769..f0765f07c 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -4978,10 +4978,10 @@ static int set_option(int opt, const char *arg, const char *optname) "-l, --load"); } else { free(opt_load_session_path); - opt_load_session_path = strdup(arg); + opt_load_session_path = utils_expand_path(arg); if (!opt_load_session_path) { - PERROR("strdup"); - ret = -ENOMEM; + ERR("Failed to expand load path %s", arg); + ret = -EINVAL; } } } else if (string_match(optname, "kmod-probes")) { -- 2.34.1