From 60b192e3836a150eb6950ce52241efebbee00f11 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Mon, 16 Jul 2012 11:23:39 +1000 Subject: Use execvp for running programs in chroot This makes us more robust to utilities changing paths. There is no functional change when a full path is specified. Signed-off-by: Allan McRae --- lib/libalpm/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/util.c') diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index c88326f2..be20ddee 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -549,9 +549,9 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[]) exit(1); } umask(0022); - execv(cmd, argv); - /* execv only returns if there was an error */ - fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno)); + execvp(cmd, argv); + /* execvp only returns if there was an error */ + fprintf(stderr, _("call to execvp failed (%s)\n"), strerror(errno)); exit(1); } else { /* this code runs for the parent only (wait on the child) */ -- cgit v1.2.3-24-g4f1b