[pacman-dev] [PATCH] pacman-lib /usr/sbin/chroot replace diff to chroot() (was in TODO)
aurelien at archlinux.org
Sun Oct 30 11:58:38 EST 2005
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...
More information about the pacman-dev