We currently store the sorry reason and old shell in the ~/.sorry and ~/.oldshell files respectively of the sorried user. This is a dangerous practice, because:
- If the user had something valuable in the
~/.sorry file, we overwrite it.
- If the user had an existing
~/.oldshell file, we lose the info about the old shell.
- Worst of all,
~/.sorry could be a symlink created by an attacker to point to important system files. In that case, we would just overwrite those files. (And the scary thing is the script, running as root, actually has permissions to do this.)
We should store this information elsewhere, preferably in a directory that only we control.