[Top][All Lists]

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

bug#24604: Add '--no-preserve-roots' flag to 'rm' for better safety

From: Mohammed Sadiq
Subject: bug#24604: Add '--no-preserve-roots' flag to 'rm' for better safety
Date: Tue, 4 Oct 2016 07:51:08 +0530

'--no-preserve-root' that can be used to ignore if the path is root when using
the 'rm' command.

But as the most of the GNU commands accepts shortened flag as long as
there is no ambiguity, this can be an issue too. So, 'rm --n' may have the
same effect as 'rm --no-preserve-root'. There may be several users unaware
of this feature which can cause several issues.

1. A cracker may be able to trick a user to bring a system down using
'--n' flag.
2. A folder/file name like '--n' as an argument to 'rm' command may
try to delete
    the whole files (in case a '/' too appears as an argument), and
the user won't
    find a reason why it happened.

One way to overcome this is set '--no-preserve-roots' too an alias for
'--no-preserve-root'. This means that the user will have include the whole flag
to ignore root check (shortening will create an ambiguity).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]