What is safe-rm?

Safe-rm is a safety tool intended to prevent the accidental deletion of important files by replacing /bin/rm with a wrapper, which checks the given arguments against a configurable blacklist of files and directories that should never be removed.

Users who attempt to delete one of these protected files or directories will not be able to do so and will be shown a warning message instead:

    $ rm -rf /usr
    Skipping /usr

(Protected paths can be set both at the site and user levels.)

Recovering important files you deleted by mistake can be quite hard. Protect yourself today by installing safe-rm and reduce the likelihood that you will need to contact a data recovery service!

(Linux/UNIX source code).

2013-06-09

Minor new release of safe-rm

A new version of safe-rm was released to fix a problem reported by Teresa e Junior.

If you've ever seen the following error:

Insecure $ENV{IFS} while running with -t switch at /usr/bin/rm line 110. Insecure dependency in system while running with -t switch at /usr/bin/rm line 110.

then you should upgrade. Otherwise, you can keep the version you have.

2013-01-11

/lib32 and /lib64 now blacklisted by default in safe-rm 0.9

A new version of safe-rm was released to add the (relatively) new /lib32 and /lib64 directories to the default blacklist. Thanks to Michael Tomkins for the suggestion!

2010-04-15

Contributing your list of protected paths to safe-rm

This is an open invitation to all safe-rm users to send in their personal lists of protected paths so that some of these can hopefully be included in a future release.

safe-rm is all about preventing little disasters and part of this involves shipping a default set of paths to protect from deletion. I've tried to guess what would be useful to people, but it's very likely that I have a missed a number of critical paths that people care about.

So if you're happy with sharing your configuration, please consider emailing your /etc/safe-rm.conf or ~/.safe-rm to francois@safe-rm.org.nz.

2009-10-15

Removal of a perl dependency in 0.8

The latest version of safe-rm removes an unnecessary dependency on the English Perl module. This makes safe-rm more robust during upgrades of the core Perl packages.

Thanks to all of those who have reported problems on the Debian bug tracker!

2009-09-23

CDPATH-related fix in safe-rm 0.7

Version 0.7 of safe-rm fixes a small untainting problem for people who have CDPATH defined in their environment. Others can safely skip this release and stick to version 0.6.

Thanks to John Ferlito, who inadvertently deleted part of his /usr/lib, for this fix!

2009-05-22

safe-rm 0.6 no longer protects symlinks

The new release of safe-rm, version 0.6, fixes a bug which caused symbolic links to protected files to be undeletable. Therefore if you create a symlink to /usr/lib, you will now be able to delete it without having to use the real rm explicitly.

You can still use safe-rm to protect regular files and directories from accidental deletion using the rm command, but symbolic links will no longer be protected.

Another minor enhancement included in this release is the change in the message displayed by safe-rm when a protected file is skipped. The new message should now make it explicit who is to blame when a file isn't being deleted.

2009-04-02

Wildcards in safe-rm 0.5

In addition to protecting specific files and directories from accidental deletion, this release of safe-rm introduces support for wildcards in protected paths.

Minor improvements were also made to the documentation and overall code quality.

Many thanks to Dave Jones for his help in getting this release in shape.
Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 New Zealand License.