coreutils
[Top][All Lists]
Advanced

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

Re: RFC: rm --preserve-root=all to protect mount points


From: Pádraig Brady
Subject: Re: RFC: rm --preserve-root=all to protect mount points
Date: Mon, 11 Jun 2018 02:29:06 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 11/06/18 01:16, L A Walsh wrote:
> Pádraig Brady wrote:
>> Rather than add a new option, I thought it cleaner
>> to extend the existing --preserve-root option to support
>> --preserve-root=all, as that can be interpreted to
>> preserve the root of all specified file systems.
>>   
> ---
>     My first comment was about hoping it wasn't going to become a 
> default

Not on by default.
Only applies to directories passed as arguments to rm.

> but more importantly: a mount != the root of a volume.
> 
> so 2) One might have many subdirs of a volume remounted in other
> locations.  If the goal is to protect the root of a volume
> and not merely all test & tmp that have sub-volumes mounted
> on them, it seems prudent to test that the mount is
> indeed the root of a volume.

The intent is to protect directory mount points.

> 3)  Also,  I've often used tmp dirs for testing that I
> later wipe w/rm-fr, especially if I reuse the volume
> for multiple tests. Scratch, test and development
> volumes are often easily cleared off with rm.
> 
> 4) are you only protecting mounts on a cmdline? or any mount
> crawled by rm underneath cmdline args? Cuz if it is the 2nd,
> wouldn't that already be handled by --one-file-system?

Yes that's an additional protection one might like to enable.

> 5a) I believe I pointed out that --one-file-system was flawed
> in that it didn't limit deletions only to 1 file system, since
> the option isn't really named --one-file-system-per-arg.
> How many people want to delete multiple file systems at one
> time by specifying them on the command line to clean out a dir,
> like  rm  foo/* -- where * expands to various mount points
> in the dir.
> 
> 
> RFE1: Is there a reason not to fix that?  I.e. check that all args
> are on 1 file system if that option is specified?
> 
> RFE2: Could '-x' as a short-op for that?  I can handle short
> flags and would really rather see --one-file-system be enforced
> at the cmdline lvl  as its name infers.
> 
> *cheers*...

I considered having the patch use --one-file-system=all
which would cater for your use case I think with a single option
rather than two. Though that would be a bit less flexible
as one then couldn't protect only cli args. I'm not fully
decided on whether that flexibility is needed.

cheers,
Pádraig



reply via email to

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