From: Tycho Andersen Date: Wed, 3 Jun 2015 06:13:23 +0000 (-0600) Subject: don't hardcode the path to criu when checking versions X-Git-Tag: lxc-1.1.3~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fd79e922f32498cb3be3e009925064504f695a5;p=thirdparty%2Flxc.git don't hardcode the path to criu when checking versions 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 Signed-off-by: Tycho Andersen Acked-by: Stéphane Graber --- diff --git a/src/lxc/criu.c b/src/lxc/criu.c index c331adf7f..c6b1863a9 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -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;