Fix: expand load path to an absolute path before daemonizing
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Sep 2018 22:43:28 +0000 (18:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Sep 2018 22:44:29 +0000 (18:44 -0400)
Relative paths must be expanded before the sessiond is daemonized
as the CWD is then changed to '/'.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.c

index 125a18769107269322813923d438e51f062694ae..f0765f07ca408147863bad83abc2dc1cecd3810c 100644 (file)
@@ -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")) {
This page took 0.027504 seconds and 4 git commands to generate.