From unknown Fri Jun 20 05:31:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15943 <15943@debbugs.gnu.org> To: bug#15943 <15943@debbugs.gnu.org> Subject: Status: [PATCH] doc: enhance diagnostic when rm skips "." or ".." arguments Reply-To: bug#15943 <15943@debbugs.gnu.org> Date: Fri, 20 Jun 2025 12:31:37 +0000 retitle 15943 [PATCH] doc: enhance diagnostic when rm skips "." or ".." arg= uments reassign 15943 coreutils submitter 15943 Linda Walsh severity 15943 normal tag 15943 notabug patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 20 19:55:33 2013 Received: (at submit) by debbugs.gnu.org; 21 Nov 2013 00:55:33 +0000 Received: from localhost ([127.0.0.1]:35466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VjIYO-0002F5-CU for submit@debbugs.gnu.org; Wed, 20 Nov 2013 19:55:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39280) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VjIYL-0002Ep-SE for submit@debbugs.gnu.org; Wed, 20 Nov 2013 19:55:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjIY8-0002B2-5K for submit@debbugs.gnu.org; Wed, 20 Nov 2013 19:55:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjIY8-0002Aw-2O for submit@debbugs.gnu.org; Wed, 20 Nov 2013 19:55:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjIY1-0000qt-Ra for bug-coreutils@gnu.org; Wed, 20 Nov 2013 19:55:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjIXv-00020Q-SO for bug-coreutils@gnu.org; Wed, 20 Nov 2013 19:55:09 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:58898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjIXv-0001qV-6t for bug-coreutils@gnu.org; Wed, 20 Nov 2013 19:55:03 -0500 Received: from [192.168.4.12] (Athenae [192.168.4.12]) by Ishtar.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id rAL0skVm058648 for ; Wed, 20 Nov 2013 16:54:48 -0800 Message-ID: <528D59D6.1040707@tlinx.org> Date: Wed, 20 Nov 2013 16:54:46 -0800 From: Linda Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Re: [PATCH] doc: enhance diagnostic when rm skips "." or ".." arguments Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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? ;-/) From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 20 21:16:42 2013 Received: (at 15943) by debbugs.gnu.org; 21 Nov 2013 02:16:42 +0000 Received: from localhost ([127.0.0.1]:35551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VjJov-0005TD-Qr for submit@debbugs.gnu.org; Wed, 20 Nov 2013 21:16:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17453) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VjJot-0005Sv-Qj; Wed, 20 Nov 2013 21:16:40 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAL2GYPA027255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Nov 2013 21:16:35 -0500 Received: from [10.3.113.132] (ovpn-113-132.phx2.redhat.com [10.3.113.132]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAL2GXQw023825; Wed, 20 Nov 2013 21:16:33 -0500 Message-ID: <528D6D01.2050807@redhat.com> Date: Wed, 20 Nov 2013 19:16:33 -0700 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Linda Walsh , 15943@debbugs.gnu.org, GNU bug tracker automated control server Subject: Re: bug#15943: [PATCH] doc: enhance diagnostic when rm skips "." or ".." arguments References: <528D59D6.1040707@tlinx.org> In-Reply-To: <528D59D6.1040707@tlinx.org> X-Enigmail-Version: 1.6 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="c8d0Qc32ruCQ9290va63OM75vt3kmqa4H" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: 15943 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.6 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --c8d0Qc32ruCQ9290va63OM75vt3kmqa4H Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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". >=20 > 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("/"). >=20 > Then the correct solution is if a user says > to remove /tmp/ > it will remove everything under /tmp but not /tmp itself? >=20 > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --c8d0Qc32ruCQ9290va63OM75vt3kmqa4H Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSjW0BAAoJEKeha0olJ0NqupAIAJUrYxkaf89uRWKw1j7d+s19 Q3ynzpLv2wvuDNLwijRfS7dfR9SQrUnKwD318Ms7TUPKvyp6JLYT1wu2hH4DAsDK HvpAEbcZYP0KJVvmA+X97JeCyo74A2E74cc9606u5jbHsnvVAuU+ZGdGCQZXwl0v T/zQ5hooaEWoO69UflBWou4BTNqEiYgFdQrj24QgdZlB/mwSPVRytVuB48n9iJfc OZSvGC9GwwajNzdqmLvlmPeDYt8BFzXplqIr18NIQZTKCiUtfRdeuNoGL3C2Yo3z jhv4cgpAktu8tpHjX9Ue9E/jczbP0KXc08su5LYozwiRZZD7hH7MGeMq1M19Yyw= =2Vxq -----END PGP SIGNATURE----- --c8d0Qc32ruCQ9290va63OM75vt3kmqa4H-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 10 12:29:08 2018 Received: (at control) by debbugs.gnu.org; 10 Oct 2018 16:29:08 +0000 Received: from localhost ([127.0.0.1]:43758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAHMC-0005YW-7Q for submit@debbugs.gnu.org; Wed, 10 Oct 2018 12:29:08 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:36201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAHMA-0005Xy-HY; Wed, 10 Oct 2018 12:29:06 -0400 Received: by mail-pf1-f171.google.com with SMTP id l81-v6so2903593pfg.3; Wed, 10 Oct 2018 09:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=8s5v16jlfVTJGqp+SOVQyGXsHEMByPn+fiMt+6r6Cmg=; b=pGKmRDIoTklwUIChF9SG7L6u/2LFK4peKdfBLDDFLa0a3KwnUnZe7zY22kcw/3qmDp +k2NRfSfFRsC7rUzNMoZe9KqvWK/BeCokKHNez5L1jZtrTkRlys4syjQIkuw3vADKnm8 Yo4p9F7f7k9Bz+CakGscNT/HndcYnxk/uJylb1sHM1Dy0heGD1Tjyxm414L4vHiwOfUX iXV86v0WAdwyRtIYpuEzWHNtWRCZIqMpzLs5Cqx88N1yGR2eBicZXhGPWKZFczSokTpM SxAbJ6KRdstByWw7xne81zrj7N2cbHPGRbLqeO35ZBnDnavsmamzw5yKkyeHSoCAoZY0 ZJOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8s5v16jlfVTJGqp+SOVQyGXsHEMByPn+fiMt+6r6Cmg=; b=MqO+QsP11guPiMhnatA2BvLBlRpD1pAQtt6BGo7fYaGrDoaQCk/9gZCcW35B3SzfZc sdkLrPo7+pFdL+HmFOPKuihtRa9ygfFkplOCafRxDaX8yajFfL5cMrSa8OiUfplKVf78 6fyAqsxw7zt6lprySCs3pLrPiBZoCGT+fqB5BubnEvCyKRu7dx2SPCcHdk9nq31Ws97x bE+z9rY339Uuh513roNhqXM3wDMEdpDwY9La0e0pAkvCko5dCnD6UFlF2/HP3GBvh4eC u7u4O1Cwy0ZxDpvgSPdJ7eX3TvFOUGqslWt4KHL5UCVwA9hjruqkZ2qHgFH/Lz911FJk qJ+A== X-Gm-Message-State: ABuFfohON4YfolCzDPQZRFbx0ty6pIxQ/IR4RYdsp+RrS686EgPk/R1T psEN15H1hmFDu1Iyl4SVe+H34HQLwtk= X-Google-Smtp-Source: ACcGV62vHpOzFn3W8aLIRQvLae3HiBCVnAD8AEookH2zL66/hxZer7IR+r/teiMDXEka7WbC6XraXA== X-Received: by 2002:a63:4c4e:: with SMTP id m14-v6mr30510246pgl.173.1539188939983; Wed, 10 Oct 2018 09:28:59 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id u190-v6sm31233388pgu.3.2018.10.10.09.28.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 09:28:58 -0700 (PDT) Subject: Re: bug#15926: RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call To: 15926@debbugs.gnu.org References: <528B520B.1080601@tlinx.org> <528B565D.4020205@draigBrady.com> <528E66BA.30002@redhat.com> From: Assaf Gordon Message-ID: <86bede85-b8ea-68d6-3400-fb27e29993ed@gmail.com> Date: Wed, 10 Oct 2018 10:28:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <528E66BA.30002@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 15926 stop (triaging old bugs) The original topic of using remove(2) call in rm(1) was decided to be undesirable. Starting at around the 33rd message [1] the thread diverges into bugs in "rm -rf ." and similar problems (which are resolved by the 221st message [2]. [1] https://bugs.gnu.org/15926#33 [2] https://bugs.gnu.org/15926#221 I'm therefore closing this item (it is already marked as "not a bug", relating to the original request). We typically write "discussion can continue by replying to this thread", but in this case I think it should not be encouraged. If there are further issues with "rm", please do start a new thread (if it's a bug - to bug-coreutils@gnu.org ; if a feature request - to coreutils@gnu.org ). regards, - assaf From unknown Fri Jun 20 05:31:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 08 Nov 2018 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator