GNU bug report logs - #15943
[PATCH] doc: enhance diagnostic when rm skips "." or ".." arguments

Previous Next

Package: coreutils;

Reported by: Linda Walsh <coreutils <at> tlinx.org>

Date: Thu, 21 Nov 2013 00:56:02 UTC

Severity: normal

Tags: notabug, patch

Merged with 15926

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15943 in the body.
You can then email your comments to 15943 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#15943; Package coreutils. (Thu, 21 Nov 2013 00:56:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Linda Walsh <coreutils <at> tlinx.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 21 Nov 2013 00:56:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Linda Walsh <coreutils <at> tlinx.org>
To: bug-coreutils <at> gnu.org
Subject: Re: [PATCH] doc: enhance diagnostic when rm skips "." or ".."
 arguments
Date: Wed, 20 Nov 2013 16:54:46 -0800
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 --preserve-root
>               is in effect -- default) diagnose and skip it.  */
>            if (ROOT_DEV_INO_CHECK (x->root_dev_ino, ent->fts_statp))
>              {
-----

So it is easier to delete everything under '/' than
under /tmp/.

Hmm...

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

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...

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






Information forwarded to bug-coreutils <at> gnu.org:
bug#15943; Package coreutils. (Thu, 21 Nov 2013 02:17:01 GMT) Full text and rfc822 format available.

Message #8 received at 15943 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Linda Walsh <coreutils <at> tlinx.org>, 15943 <at> debbugs.gnu.org,
 GNU bug tracker automated control server <control <at> debbugs.gnu.org>
Subject: Re: bug#15943: [PATCH] doc: enhance diagnostic when rm skips "."
 or ".." arguments
Date: Wed, 20 Nov 2013 19:16:33 -0700
[Message part 1 (text/plain, inline)]
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

[signature.asc (application/pgp-signature, attachment)]

Forcibly Merged 15926 15943. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Thu, 21 Nov 2013 02:17:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 15926 <at> debbugs.gnu.org and Linda Walsh <coreutils <at> tlinx.org> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 10 Oct 2018 16:30:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 08 Nov 2018 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 225 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.