summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-07-10 17:26:06 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-10 16:13:43 +0000
commit84cfdb20617ac7a5a1138375599e28cdad26b824 (patch)
tree49bb2f7408a213dae1da464622a405700c84dca8
parent4f9b1ae62553efb2f88ec143ed0782585e7d8d51 (diff)
downloadpodman-84cfdb20617ac7a5a1138375599e28cdad26b824.tar.gz
podman-84cfdb20617ac7a5a1138375599e28cdad26b824.tar.bz2
podman-84cfdb20617ac7a5a1138375599e28cdad26b824.zip
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
-rw-r--r--pkg/rootless/rootless_linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/rootless/rootless_linux.c b/pkg/rootless/rootless_linux.c
index 0f2008375..f2684f75f 100644
--- a/pkg/rootless/rootless_linux.c
+++ b/pkg/rootless/rootless_linux.c
@@ -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);
}