bug-hurd
[Top][All Lists]
Advanced

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

Re: rm patch suggestion


From: Oystein Viggen
Subject: Re: rm patch suggestion
Date: Tue, 07 May 2002 18:44:29 +0200
User-agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.1 (Capitol Reef, i386-debian-linux)

* [Joshua Judson Rosen] 

> On Tue, May 07, 2002 at 05:08:58PM +0200, Oystein Viggen wrote:
>
>> People will expect -Rf to as safe from subversion on the Hurd as it is
>> in any other Unix like OS.
>
> Right..., which normally includes descending through mountpoints, doesn't it?

Root descending into a mountpoint owned by root is nice, useful, and
safe, provided that root knows what he is doing.  Root descending into a
mountpoint owned by oysteivi or rozzin is a disaster waiting to happen.

The extreme case of rm -Rf following all translators in the Hurd would
be like rm -Rf following directory symlinks in any other system.  You
don't tell people to use rm -Rfs to not follow symlinks.  You don't even
have an option for following symlinks, as people generally regard this
as a stupid thing to do.

> Whether or not recursive actions should default to going through
> mountpoints is debatable, but it seems to be a/the current popular
> behaviour:
>
>         cp traverses mountpoints unless -x/--one-file-system is given
>
>         tar traverses mountpoints unless -l/--one-file-system is given
>
>         find traverses mountpoints unless -xdev/-mount is given

(Incidentally, I don't think these options currently work at all in the
Hurd, but they should, and fixing them shouldn't be too hard.)

Those examples read stuff.  rm writes.  There is usually no big harm
done in copying too much, but the same can not be said for deleting.
rm has a greater need of paranoia than the programs you mention.

> I would expect other programs to behave similarly.

I think most people coming from Unix to the Hurd would expect 
rm -Rf /tmp/* not to turn into rm -Rf / all of a sudden.  If we expect
people to read documentation and discover that they need to use -Rft to
be on the safe side, I think we're expecting too much.

> The `act differently for translators beloning to other users' proposal
> is interesting, and might warrant an additional toggle-flag....

I like the concept, as this would be a lot more like descending into
mount points without the descending into symlinked directories part.
(or at least, it only descends into peoples own "symlinks", which makes
it their own fault, and not our problem ;)

> There's a slew of similarly-minded behaviour-tweaks that one might
> want at a given moment, though--one might also want to filter based on
> the specific translator set on a node (e.g.: go into nodes translated
> by /hurd/ext2fs, but don't go into nodes translated by /hurd/firmlink
> or /hurd/ftpfs or /hurd/tarfs)--and these are probably applicable to
> any utility that operates on directory-trees/-webs....

This would be cool, but I agree that implementingn this in rm would be a
bit over the top.

> I don't normally expect such fine-grained control built-into
> individual utilities, though--I usually figure `that's what find and
> xargs are for'.

A find -> showtrans -> rm solution is likely to be racey, and thus not
safe for a live system.  (people can change the translator between the
showtrans and the rm).


By the way, how many people have actually ever descended into a mount
point *on purpuse* using rm -Rf?  When I want to clear a filesystem, I
usually use mke2fs, as this is usually much faster..

Oystein
-- 
This message was brought to you by the letter ß and the number e.



reply via email to

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