From: Jérémie Galarneau Date: Thu, 13 Sep 2018 22:43:28 +0000 (-0400) Subject: Fix: expand load path to an absolute path before daemonizing X-Git-Tag: v2.9.11~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=aacbfa47ad16d5778726b678c095b824d75d388b;p=lttng-tools.git Fix: expand load path to an absolute path before daemonizing Relative paths must be expanded before the sessiond is daemonized as the CWD is then changed to '/'. Signed-off-by: Jérémie Galarneau --- 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")) {