This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Lymia Aluysia's profile picture

[ComputerCraft 1.2] chroot v1.0.5 - sandboxing and custom rom launching utility

Started by Lymia Aluysia, 28 January 2012 - 08:24 AM
Lymia Aluysia #1
Posted 28 January 2012 - 09:24 AM
This program is basically a clone of the Unix chroot program.
When you run chroot on a directory, it sets the root directory to that directory, creating a sandbox. All programs should work from inside the sandbox, and nothing inside the sandbox should be able to touch files outside of it.
To use this program, you create a chroot environment by typing in "mkroot [directory]", then enter it by typing in "chroot [directory]"

(Due to the nature of this program, it will most likely not work on future versions of ComputerCraft, and will need updating for them. The download is attached to this post. Versions before v1.0.5 can be found here.)

==Changelog==
Version v1.0:
- Initial Release
Version v1.0.1:
- Added check in bios.lua to prevent it from being run with a BIOS already running (why didn't I think of doing this last version?)
Version v1.0.2:
- Fixed mkroot for recursive chroots
- Added code in bios.lua so that rednet (hopefully) will work if started in an external system without rednet.
Version v1.0.3:
- chroot now adds http to the chroot environment if it exists. Don't ask me to do the same for luajava. That will never happen.
Version v1.0.4:
- Fixed .. in the root directory
- Fixed access to external environment by calling getfenv on external functions
- Added disk access to the chroot environment (possibly dangerous if the chroot is on a disk itself.)
Version v1.0.5:
- Dealt with the remaining known sandbox leaks.
bik1230 #2
Posted 10 February 2012 - 09:19 PM
0 replies.

Not anymore :D/>/>
FuzzyPurp #3
Posted 12 February 2012 - 08:46 AM
What's the latest?
Mandrake Fernflower #4
Posted 16 February 2012 - 03:23 PM
Quick question. Where does bios.lua belong? I tried putting the mkroot and chroot programs in the /rom/programs folder
and the bios.lua in /rom. When I run makeroot it says "BIOS cannot be found"
rockymc #5
Posted 16 February 2012 - 03:44 PM
Bios.lua is in the same folder as rom.
Mandrake Fernflower #6
Posted 16 February 2012 - 04:21 PM
you mean replace the BIOS with the one given?
Mandrake Fernflower #7
Posted 16 February 2012 - 04:24 PM
Tried it did not work. :C
FuzzyPurp #8
Posted 28 February 2012 - 03:48 AM
Update. Now!