rootless: fix when argv[0] is not an absolute path

use execvp instead of exec so that we keep the PATH environment
variable and the lookup for the "podman" executable works.

Closes: https://github.com/projectatomic/libpod/issues/1070

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1072
Approved by: mheon
This commit is contained in:
Giuseppe Scrivano 2018-07-10 17:26:06 +02:00 committed by Atomic Bot
parent 4f9b1ae625
commit 84cfdb2061
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ reexec_in_user_namespace(int ready)
setresuid (0, 0, 0) < 0)
_exit (1);
execv (argv[0], argv);
execvp (argv[0], argv);
_exit (1);
}