select * from sectionselect * from sectionselect * from section JMC Research - Juan M. Casillas Web Site
Knowledge for our questions, fun for everyone!

http://www.jmcresearch.com/src/articlehelper.php?id=9
Printed at 19/03/2024 06:43:06
http://www.jmcresearch.com Knowledge for our questions, fun for everyone!
Adding software to Jail
Or how to invoke addjailsw

Published at 26/08/2003 17:10:48
By Juan M. Casillas

addjailsw will copy the programs and the dependencies (libraries, auxiliar files, special devices) into the right places in the chrooted environment. addjailsw has been written in perl script. This are the command line arguments:

addjailsw chrootdir [-D] [-P program args]
Argument Description
chrootdir The directory where the chrooted environment will live. It its the home entry in the non-chrooted /etc/passwd file
-P program args (optional) installs the specific program "program" into the chrooted environment. The script uses the "args" parameter to launch the program where doing the strace command, to allows the program exit nicely, so the strace can do its work. If this parameter isn?t specified, the standard programs included in the file will be installed. See addjailsw?s code for in-deep details.

Invocation examples:

addjailsw /var/chroot

addjailsw /var/chroot -D

addjailsw /var/chroot -P vi "-c q"

The first invocation will add the standard programs under the /var/choot directory. The second invocation will do the same that first?s but also will show what files are going to be copied in /var/chroot. Last, the third invocation will install only the program vi, and when launched in the strace call, the arguments "-c q" will be passed to it (so vi will exit inmediatly).


http://www.jmcresearch.com Knowledge for our questions, fun for everyone!