coreutils
[Top][All Lists]
Advanced

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

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


From: Philip Rowlands
Subject: Re: rm --do-what-i-mean
Date: Sun, 07 May 2023 13:27:41 +0100
User-agent: Cyrus-JMAP/3.9.0-alpha0-386-g2404815117-fm-20230425.001-g24048151

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.


Cheers,
Phil



reply via email to

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