coreutils
[Top][All Lists]
Advanced

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

Re: rm --do-what-i-mean


From: Pádraig Brady
Subject: Re: rm --do-what-i-mean
Date: Sun, 7 May 2023 13:59:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Thunderbird/109.0

On 07/05/2023 13:27, Philip Rowlands wrote:
On Sat, 6 May 2023, at 17:35, Pádraig Brady wrote:

As for -f implicitly bypassing this protection,
that seems too risky at this stage, as systems
could be dependent on this protection on dirs.
I.e. if we were to support this functionality
it would have to be under a new option as you suggest
(which does detract a bit from adding it).

I'd find it odd to write
rm -rf DIR
and expect the permissions to _protect_ certain files, but who knows what 
existing code is out there?

Narrowly-scoped, we could have
rm -r --chmod-unwritable-directories
which does one specific thing.

On the other hand, we could have
rm -r --try-harder
towards the idea of "if these files can be deleted, then delete them". What 
could this entail? chmod, chattr, setfacl, semanage, sudo??

It would be a shame for the perfect solution to be the enemy of the good, so if 
--try-harder were documented initially to chmod, but reserving the right to 
--try-harder in other ways as and when the need arises, would that fly?

The footrake I always step on is expanded archives which for some reason have 
0555 directories, and by the time I've noticed it's too late.

Well the higher level the better,
so if we were to implement it,
it would be something like:

  -F, --try-harder

cheers,
Pádraig




reply via email to

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