]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
don't hardcode the path to criu when checking versions
authorTycho Andersen <tycho.andersen@canonical.com>
Wed, 3 Jun 2015 06:13:23 +0000 (00:13 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 1 Jul 2015 17:41:59 +0000 (13:41 -0400)
We use the right path when actually execing criu to checkpoint and restore, but
when checking versions we didn't. Let's use the right path.

Reported-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/criu.c

index c331adf7f126a6107c735509c2064c97b947925e..c6b1863a9a58826692bc624e817bb5005db0fb49 100644 (file)
@@ -223,13 +223,15 @@ static bool criu_version_ok()
 
        if (pid == 0) {
                char *args[] = { "criu", "--version", NULL };
+               char *path;
                close(pipes[0]);
 
                close(STDERR_FILENO);
                if (dup2(pipes[1], STDOUT_FILENO) < 0)
                        exit(1);
 
-               execv("/usr/local/sbin/criu", args);
+               path = on_path("criu", NULL);
+               execv(path, args);
                exit(1);
        } else {
                FILE *f;