GNU bug report logs -
#15926
RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call
Previous Next
Reported by: Linda Walsh <coreutils <at> tlinx.org>
Date: Tue, 19 Nov 2013 11:58:02 UTC
Severity: normal
Tags: notabug, patch
Merged with 15943
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #53 received at control <at> debbugs.gnu.org (full text, mbox):
[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)]
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.