bug-coreutils
[Top][All Lists]
Advanced

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

bug#15943: [PATCH] doc: enhance diagnostic when rm skips "." or ".." arg


From: Eric Blake
Subject: bug#15943: [PATCH] doc: enhance diagnostic when rm skips "." or ".." arguments
Date: Wed, 20 Nov 2013 19:16:33 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

forcemerge 15943 15926
thanks

On 11/20/2013 05:54 PM, Linda Walsh wrote:
> On 20/11/2013 15:47, Bernhard Voelker wrote:
>>
>> -          /* If a command line argument resolves to "/" (and
>> --preserve-root
>> +          /* POSIX also says:
>> +             If a command line argument resolves to "/" (and

No need to spawn a new bug when the existing bug tracking the issue is
still under discussion.  And on the surface, this email has nothing to
do with the subject line of "enhance diagnostic when rm skips "." or
".." arguments".

> 
> Maybe since '/' doesn't really delete the file system itself,
> but only files and dirs underneath '/',

Huh?  When POSIX-compliant (that is, when --preserve-root is in effect),
attempting to 'rm -r /' does nothing at all.  When bypassing POSIX (with
'rm -r --no-preserve-root'), rm will delete as much as possible, and
eventually fail once it has deleted system resources that were essential
to the correct operation of the computer; but if you can get far enough,
it would eventually attempt rm("/").

> 
> Then the correct solution is if a user says
> to remove /tmp/
> it will remove everything under /tmp but not /tmp itself?
> 
> That doesn't seem to be disallowed by POSIX...

Not true.  POSIX requires 'rm -r /tmp/' to attempt to delete /tmp, but
that it might fail to do so if nested files are not deleted (perhaps due
to ownership) or if the user doesn't have rights to delete /tmp.

> (its a bit absurd, but as long as it conforms to POSIX
> it should be fine, right? ;-/)

Your idea of skipping the attempt to delete /tmp would not conform with
POSIX.


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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