FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-16-2012, 01:41 AM
Allan McRae
 
Default 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 <allan@archlinux.org>
---
lib/libalpm/util.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index c2b5d44..bdb9e56 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)
"), strerror(errno));
+ execvp(cmd, argv);
+ /* execvp only returns if there was an error */
+ fprintf(stderr, _("call to execvp failed (%s)
"), strerror(errno));
exit(1);
} else {
/* this code runs for the parent only (wait on the child) */
--
1.7.11.2
 

Thread Tools




All times are GMT. The time now is 10:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org