3 ms·
This looks cool, and the script actually seems pretty small, but I am not entirely sure I understand what it does. My naive understanding skimming through the
by palata 3y ago
This looks cool, and the script actually seems pretty small, but I am not entirely sure I understand what it does.
My naive understanding skimming through the code:
1- It mounts the entire (?) filesystem in what I will call "overlayfs mount points" (doesn't it need root access for that?)
2- It executes the command on that "sandbox", which looks exactly like the rootfs, but is actually an overlay
3- Once the command returns, it knows what has been changed in the overlay, and shows it to the user. The user can then "commit" those changes (in which case I assume the command writes them from the overlayfs to the actual rootfs)
Everything that does not happen on the filesystem (e.g. a network call) won't be "tried", it will just happen.
Is that about right?
- evgpbfhnr 3y agoyes; the mount doesn't need root access because of user namespaces (which is one of the linux features with the most vulnerabilities next to BPF, but it's also quite handy...) the sandbox is just a directory with the overlayfs content (whole new files for modified files, whiteouts for removals); there's some bugs e.g. removing a directory will create a whiteout that the apply script will try to rm without -r, and there's a handful of other failure modes I can think of (really doing network etc), but for simple commands it's a nice idea.
- KRAKRISMOTT 3y agoWhat about the checkinstall command? How does that work?