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

Christian Hamar krics at linuxforum.hu
Sun Oct 30 08:45:03 EST 2005

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. 

Please test it and see it, if it is ok, then commit it. (I tested it,
worked for me)


Christian Hamar alias krix
Frugalware Development Team

-------------- next part --------------
A non-text attachment was scrubbed...
Name: chroot-try1.diff
Type: text/x-patch
Size: 2688 bytes
Desc: not available
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20051030/c235f88b/attachment.bin>

More information about the pacman-dev mailing list