[pacman-dev] [PATCH] pacman-lib /usr/sbin/chroot replace diff to chroot() (was in TODO)

Aurelien Foret aurelien at archlinux.org
Sat Nov 5 14:23:42 EST 2005

OK. Applied.

BTW, I added a call to waitpid() after the fork() one in the main 
process, so that it waits for the child death before resuming its 


Aurelien Foret wrote:
> Christian Hamar wrote:
>>Hello there.
>>So i completed other entry which was in TODO.
>>I hacked pacman-lib to use chroot() system calls and not the binary one.
>>Entry was in TODO.
>>The attached patch is for latest checked pacman-lib, which is:
>>2005-10-29 09:18  aurelien
>>        * src/pacman/: conf.c, conf.h: fixed parseconfig usage
>>Patch description:
>>  * Removed old chroot binary detection part
>>  * Removed global declaration for chrootbin.
>>  * Added a complete new way to chroot and do things.
>>  * Modified cmdline snprintf's to right way. Eliminated | (pipe) and
>>echo things, which looked terrible ugly :)
>>As you need to know, this patch using a fork() and chroot() and execl()
>>instead of system() call. execl() looks better and safer. fork() is
>>required for chrooting in child process, if i do not do a fork() then
>>whole process stays in chrooted env. So fork is neccessary as i think. 
> That's exactly how I wanted it to be.
>>Please test it and see it, if it is ok, then commit it. (I tested it,
>>worked for me)
> I'll have a look at it...
> --
> Aurelien

More information about the pacman-dev mailing list