3 ms·
What about using LD_PRELOAD to load a FS shim that prevents writing to the FS?
by jspears 8y ago
What about using LD_PRELOAD to load a FS shim that prevents writing to the FS?
- _kst_ 8y agoWhat about making the tool behave sanely so you don't have to play tricks with the OS to protect yourself from its behavior? If I type "grep", I don't want it to try to execute "g", "gr", and "gre" as I type it -- not if those commands don't exist, and especially not if they do. Just don't execute a command unless the user requests it (say, by typing Enter). Problem solved.
- jspears 8y agoIt would remove the live execution bits which are kinda neet. I think the cli has a lot of life left in it and ideas like this are worth exploring. Perhaps compromises are necessary but I would love a tool that pretends to execute something shows the results and gives the option of committing those changes. Think of a find | xargs grep | rm That then shows the output but prompts the user for commit.
- akavel 8y agoI don't think LD_PRELOAD would be enough; there are programs which don't use libc and reach straight for syscalls (e.g. the whole Go ecosystem/runtime)
- jspears 8y agoSure; it wouldn’t be perfect safety but would work for a large swath of Unix tools.