3 ms·
here's a dumb idea off the top of my head: /etc/rmblacklist.conf autopopulated (by the distro) with a list of files (/boot and the actual bootimage for instance
by Avshalom 11y ago
here's a dumb idea off the top of my head: /etc/rmblacklist.conf autopopulated (by the distro) with a list of files (/boot and the actual bootimage for instance) that requires a GNU style long option --nuke to delete. It's still easily scriptable but you'd rarely ever actually need it and requiring a long option would serve as a double check that you meant it when you did.
Sure it's still possible to --nuke something due to a bug or negligence but I bet it'd cut down on fatal errors. Plus the user could have their own ~/.rmblacklist.conf to guard against particularly persistent dyslexias.
You could even erase the contents entirely if you really think being able to delete root on a whim keeps your kung fu strong.
- justinlardinois 11y agoThis isn't a bad idea.
- nickpsecurity 11y agoGood to see you fighting the fight with many sensible ideas. I've been posting this one in most responses as it's pretty simple: https://launchpad.net/safe-rm https://launchpad.net/safe-rm
- Avshalom 11y agoHah! Beat me to the punch by 5 years.
- nickpsecurity 11y agoDarn, I didnt notice it was that old. Makes situation even worse for UNIX rm defenders. Like when Trusted Xenix eliminated setuid vuln's mostly by clearing setuid bit during a write w/ admin having to manually reset it. Simple shit. Mainstream response? "Just audit all your apps for setuid and be extra careful in..." (sighs)
- Tiksi 11y agoYou could just make the file immutable and read only: http://paste.click/qMpmyO http://paste.click/qMpmyO Then remove the immutable flag if needed