[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: preventing accidental deletion of system directories

On Sat, 22 Mar 2008 22:16:12 +1300,
Francois Marier <francois@debian.org> wrote:
> - how to get this script to be picked up before 'rm' in the PATH (including
>   when using sudo) or whether it should be an alias in all of the shell
>   global config files (like /etc/bash.bashrc)

Call the script directly.

> - where to find a good list of directories which should never be deleted

This should be configurable by the user.

> - how to effectively disable it if one really wants to delete a system dir
>   (for an alias, '\rm' does the trick, for a command in the path, maybe an
>   environment variable?)

Call rm directly.

> - ways to detect directories expressed like  "../../../usr/lib/../../usr/bin"

realpath in Cwd.pm may be what you want.

> - any other comments/suggestions you may have about the idea or the script

The script should handle options of rm rather than assume all arguments
are file names.  I want to do rm -r some_dir.

Oohara Yuuma <oohara@libra.interq.or.jp>

If we know when, can we do it right?
--- TAITO "Ray Crisis"

Reply to: