[pacman-dev] [PATCH] pacman-lib /usr/sbin/chroot replace diff to chroot() (was in TODO)
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: -------- * Removed old chroot binary detection part * Removed global declaration for chrootbin. Added: ------ * Added a complete new way to chroot and do things. Modified: --------- * 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) Regards Christian Hamar alias krix Hungary Frugalware Development Team
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: -------- * Removed old chroot binary detection part * Removed global declaration for chrootbin.
Added: ------ * Added a complete new way to chroot and do things.
Modified: --------- * 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
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 operations. Thanks -- Aurelien 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: -------- * Removed old chroot binary detection part * Removed global declaration for chrootbin.
Added: ------ * Added a complete new way to chroot and do things.
Modified: --------- * 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
2005. 11. 5, szombat keltezéssel 20.23-kor Aurelien Foret ezt írta:
OK. Applied.
thx.
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 operations.
Ah. forgot it. Thanks for improvement. Regards -krix
participants (2)
-
Aurelien Foret
-
Christian Hamar