It creates a new mount namespace, and bind-mounts your ENTIRE filesystem into it, before chrooting, so that it can optionally remount / as ro to prevent applications from writing outside of the desired directories. The namespace is to allow doing the bind mounts in the first place.
I don't use macOS often-enough to know for sure, but a quick search suggests that bind-mounts (or similar) are more complicated on macOS. Not against the idea tho! Edit: > and would massively simplify how I build my dotfiles. I guess I should tell r/unixporn at some point, huh? (:
It sadly can't. Regex paths are hard due to the way it's implemented; if it was intercepting syscalls via ptrace then regex would be a lot more viable, but since this is just a glorified collection of bind mounts in the end, I'm unsure how I'd implement that nicely...
Okay understood. Consider adding a way to query all files written by a boxed application. If it generated a config file based on this info that would be super useful. Thanks for considering!
Comments (239) 44 threads
Earlier commentsReally interesting project for other use cases too btw.
No! The directory in /tmp outside of the "box" is completely empty; the remount of / is only seen within the mount namespace.
I don't use macOS often-enough to know for sure, but a quick search suggests that bind-mounts (or similar) are more complicated on macOS. Not against the idea tho!
Edit:
> and would massively simplify how I build my dotfiles.
I guess I should tell r/unixporn at some point, huh? (:
All comments shown.
Couldn't load more comments. Check your connection and try again.