Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Solution...if you must' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Solution...if you must
Authored by: james_sorenson on May 12, '04 02:54:49PM

A quick fix is to set your home folder to "Read Only." You will be able to add and delete files within the subfolders (like ~/Documents) but you will not be able to delete ~/Docuemts or ~/Music without SUDO access. In the finder, it will cue you for your password.

Another, more thorough solution, is to move rm to a directory not located in your path. (/usr/admintools for instance)
create a perl script in rm that simply checks the parameters for removing recursively through your home folder, System Folder, or Applications folder. Parameters that are sub-folders of that are permissible.
If the command is deemed permissible, it calls:
system('/usr/admintools/rm $PARAMETERS') or something to that effect.
Now, system calls should be fine because they aren't calling to recursively delete your home folder or Applications folder. If you truly want to do such a thing, you know to call it directly from the admintools directory.

Is this a great idea? No. A user should be asking where the file came from. Trojans usually nail the idiots who are downloading pirated music and applications through P2P software, or are mindlessly opening email attachments. Nothing like a hard lesson or two to straighten out your computing habits.

---
"I love deadlines. I love the whooshing sound they make as they fly by." - Douglas Adams



[ Reply to This | # ]
no protection
Authored by: progs on May 17, '04 01:45:05AM

making your home directory write protected does not protect you. the rm -rf command just moves into directories that it can delete. The directories in your ~ (Documents, Pictures, etc) will still be there but they will be empty. I guess that is the idea behind a recursive delete.



[ Reply to This | # ]