From unknown Sun Jun 22 00:53:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22998: File removal bug Resent-From: Avineshwar Singh Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 12 Mar 2016 17:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22998 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 22998@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.145780473220923 (code B ref -1); Sat, 12 Mar 2016 17:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Mar 2016 17:45:32 +0000 Received: from localhost ([127.0.0.1]:46443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aenbY-0005RP-Fq for submit@debbugs.gnu.org; Sat, 12 Mar 2016 12:45:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42891) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aenPx-0005BC-O3 for submit@debbugs.gnu.org; Sat, 12 Mar 2016 12:33:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aenPr-0005MR-M9 for submit@debbugs.gnu.org; Sat, 12 Mar 2016 12:33:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aenPr-0005MN-JE for submit@debbugs.gnu.org; Sat, 12 Mar 2016 12:33:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aenPq-0007Lk-O2 for bug-coreutils@gnu.org; Sat, 12 Mar 2016 12:33:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aenPn-0005La-J0 for bug-coreutils@gnu.org; Sat, 12 Mar 2016 12:33:26 -0500 Received: from nexus.stevens.edu ([155.246.14.12]:37930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aenPn-0005L3-G1 for bug-coreutils@gnu.org; Sat, 12 Mar 2016 12:33:23 -0500 Received: from avalon.srcit.stevens-tech.edu (eva.srcit.stevens-tech.edu [155.246.89.108]) by nexus.stevens.edu (Postfix) with ESMTP id E73BF182DBB for ; Sat, 12 Mar 2016 12:33:22 -0500 (EST) Received: by avalon.srcit.stevens-tech.edu (Postfix, from userid 12566) id E330186899; Sat, 12 Mar 2016 12:33:22 -0500 (EST) Date: Sat, 12 Mar 2016 12:33:22 -0500 From: Avineshwar Singh Message-ID: <20160312173322.GA15973@stevens.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Mailman-Approved-At: Sat, 12 Mar 2016 12:45:31 -0500 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: -5.0 (-----) Hi. Let's say I manage to create a file named "-filename.extension". It's not being removed using "rm -filename.extension", however, it is being removed using "/filepath/-filename.extension". There is a potential fix for this. It is existing in Ubuntu, Fedora, NetBSD, FreeBSD and OmniOS, atleast. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 12 22:48:07 2016 Received: (at control) by debbugs.gnu.org; 13 Mar 2016 03:48:08 +0000 Received: from localhost ([127.0.0.1]:46570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aex0h-0002YX-Mo for submit@debbugs.gnu.org; Sat, 12 Mar 2016 22:48:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32963) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aex0f-0002Xy-98; Sat, 12 Mar 2016 22:48:05 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 62917201; Sun, 13 Mar 2016 03:47:59 +0000 (UTC) Received: from [10.3.113.30] (ovpn-113-30.phx2.redhat.com [10.3.113.30]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2D3lweu024354; Sat, 12 Mar 2016 22:47:58 -0500 Subject: Re: bug#22998: File removal bug To: Avineshwar Singh , 22998-done@debbugs.gnu.org References: <20160312173322.GA15973@stevens.edu> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56E4E2EE.4070705@redhat.com> Date: Sat, 12 Mar 2016 20:47:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160312173322.GA15973@stevens.edu> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SLn7BbdFsP46X1BNKmIK8vsCCO8uACG3h" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Spam-Score: -5.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: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SLn7BbdFsP46X1BNKmIK8vsCCO8uACG3h Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 22998 notabug thanks On 03/12/2016 10:33 AM, Avineshwar Singh wrote: > Hi. >=20 > Let's say I manage to create a file named "-filename.extension". It's n= ot being removed using "rm -filename.extension", Indeed, and that's a FAQ: https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#I-have-a-fi= le-called-_002d_002dhelp_002e-How-do-I-remove-it_003f > however, it is being removed using "/filepath/-filename.extension". Indeed, and that is one of the work-arounds for this non-bug. The other workaround is to use: rm -- -filename.extension. > There is a potential fix for this. It is existing in Ubuntu, Fedora, Ne= tBSD, FreeBSD and OmniOS, atleast. This is not a bug, but the behavior mandated by POSIX. Therefore I'm closing this report. However, feel free to ask further related questions in response to this thread. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SLn7BbdFsP46X1BNKmIK8vsCCO8uACG3h Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW5OLuAAoJEKeha0olJ0NqwXkH/2p7D/Ikaib8IPyYxPhjtYp8 mACadkfS/w1su74XllNN6t7GXDHRvxHjYcyAjV8Mju+1J4kNRmjII9X37/an1Uj4 dQDqJoUVgQcI/+6zTjYXMa+zSLKO3c5yopDDoIkXAnxxJi/W00ItRO3OaddAriCC kTBUKWUUaUL+XWIjY91MkNYSYqJOljUnSwQrZilNjb13bRQLkJamxG1sW+IIWjnp PzsWQC7SYUabBjh89yeIILupVZsy6wlfbAQNFpRlUkXKxPv73BPaI9EXvdVXfl7F H1vkyJCwTO4RL5ODHbRPYKXKCFGLdTPl0HMWaJAU6lzLnMJZ50HncmlXdokzeR4= =HIgQ -----END PGP SIGNATURE----- --SLn7BbdFsP46X1BNKmIK8vsCCO8uACG3h-- From unknown Sun Jun 22 00:53:46 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Avineshwar Singh Subject: bug#22998: closed (Re: bug#22998: File removal bug) Message-ID: References: <56E4E2EE.4070705@redhat.com> <20160312173322.GA15973@stevens.edu> X-Gnu-PR-Message: they-closed 22998 X-Gnu-PR-Package: coreutils X-Gnu-PR-Keywords: notabug Reply-To: 22998@debbugs.gnu.org Date: Sun, 13 Mar 2016 03:49:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1457840942-9911-1" This is a multi-part message in MIME format... ------------=_1457840942-9911-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #22998: File removal bug which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 22998@debbugs.gnu.org. --=20 22998: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D22998 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1457840942-9911-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 22998-done) by debbugs.gnu.org; 13 Mar 2016 03:48:07 +0000 Received: from localhost ([127.0.0.1]:46568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aex0h-0002YV-FQ for submit@debbugs.gnu.org; Sat, 12 Mar 2016 22:48:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32963) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aex0f-0002Xy-98; Sat, 12 Mar 2016 22:48:05 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 62917201; Sun, 13 Mar 2016 03:47:59 +0000 (UTC) Received: from [10.3.113.30] (ovpn-113-30.phx2.redhat.com [10.3.113.30]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2D3lweu024354; Sat, 12 Mar 2016 22:47:58 -0500 Subject: Re: bug#22998: File removal bug To: Avineshwar Singh , 22998-done@debbugs.gnu.org References: <20160312173322.GA15973@stevens.edu> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56E4E2EE.4070705@redhat.com> Date: Sat, 12 Mar 2016 20:47:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160312173322.GA15973@stevens.edu> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SLn7BbdFsP46X1BNKmIK8vsCCO8uACG3h" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22998-done 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: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SLn7BbdFsP46X1BNKmIK8vsCCO8uACG3h Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 22998 notabug thanks On 03/12/2016 10:33 AM, Avineshwar Singh wrote: > Hi. >=20 > Let's say I manage to create a file named "-filename.extension". It's n= ot being removed using "rm -filename.extension", Indeed, and that's a FAQ: https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#I-have-a-fi= le-called-_002d_002dhelp_002e-How-do-I-remove-it_003f > however, it is being removed using "/filepath/-filename.extension". Indeed, and that is one of the work-arounds for this non-bug. The other workaround is to use: rm -- -filename.extension. > There is a potential fix for this. It is existing in Ubuntu, Fedora, Ne= tBSD, FreeBSD and OmniOS, atleast. This is not a bug, but the behavior mandated by POSIX. Therefore I'm closing this report. However, feel free to ask further related questions in response to this thread. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SLn7BbdFsP46X1BNKmIK8vsCCO8uACG3h Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW5OLuAAoJEKeha0olJ0NqwXkH/2p7D/Ikaib8IPyYxPhjtYp8 mACadkfS/w1su74XllNN6t7GXDHRvxHjYcyAjV8Mju+1J4kNRmjII9X37/an1Uj4 dQDqJoUVgQcI/+6zTjYXMa+zSLKO3c5yopDDoIkXAnxxJi/W00ItRO3OaddAriCC kTBUKWUUaUL+XWIjY91MkNYSYqJOljUnSwQrZilNjb13bRQLkJamxG1sW+IIWjnp PzsWQC7SYUabBjh89yeIILupVZsy6wlfbAQNFpRlUkXKxPv73BPaI9EXvdVXfl7F H1vkyJCwTO4RL5ODHbRPYKXKCFGLdTPl0HMWaJAU6lzLnMJZ50HncmlXdokzeR4= =HIgQ -----END PGP SIGNATURE----- --SLn7BbdFsP46X1BNKmIK8vsCCO8uACG3h-- ------------=_1457840942-9911-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 12 Mar 2016 17:45:32 +0000 Received: from localhost ([127.0.0.1]:46443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aenbY-0005RP-Fq for submit@debbugs.gnu.org; Sat, 12 Mar 2016 12:45:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42891) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aenPx-0005BC-O3 for submit@debbugs.gnu.org; Sat, 12 Mar 2016 12:33:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aenPr-0005MR-M9 for submit@debbugs.gnu.org; Sat, 12 Mar 2016 12:33:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aenPr-0005MN-JE for submit@debbugs.gnu.org; Sat, 12 Mar 2016 12:33:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aenPq-0007Lk-O2 for bug-coreutils@gnu.org; Sat, 12 Mar 2016 12:33:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aenPn-0005La-J0 for bug-coreutils@gnu.org; Sat, 12 Mar 2016 12:33:26 -0500 Received: from nexus.stevens.edu ([155.246.14.12]:37930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aenPn-0005L3-G1 for bug-coreutils@gnu.org; Sat, 12 Mar 2016 12:33:23 -0500 Received: from avalon.srcit.stevens-tech.edu (eva.srcit.stevens-tech.edu [155.246.89.108]) by nexus.stevens.edu (Postfix) with ESMTP id E73BF182DBB for ; Sat, 12 Mar 2016 12:33:22 -0500 (EST) Received: by avalon.srcit.stevens-tech.edu (Postfix, from userid 12566) id E330186899; Sat, 12 Mar 2016 12:33:22 -0500 (EST) Date: Sat, 12 Mar 2016 12:33:22 -0500 From: Avineshwar Singh To: bug-coreutils@gnu.org Subject: File removal bug Message-ID: <20160312173322.GA15973@stevens.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 12 Mar 2016 12:45:31 -0500 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: -5.0 (-----) Hi. Let's say I manage to create a file named "-filename.extension". It's not being removed using "rm -filename.extension", however, it is being removed using "/filepath/-filename.extension". There is a potential fix for this. It is existing in Ubuntu, Fedora, NetBSD, FreeBSD and OmniOS, atleast. ------------=_1457840942-9911-1--