GNU bug report logs - #34700
rm refuses to remove files owned by the user, even in force mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: Nicolas Mailhot <nicolas.mailhot@HIDDEN>; Keywords: notabug; dated Fri, 1 Mar 2019 13:38:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) notabug. Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 34700 <at> debbugs.gnu.org:


Received: (at 34700) by debbugs.gnu.org; 28 Mar 2019 18:27:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 28 14:27:31 2019
Received: from localhost ([127.0.0.1]:34711 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h9ZkR-0007ZB-Kl
	for submit <at> debbugs.gnu.org; Thu, 28 Mar 2019 14:27:31 -0400
Received: from mail-pf1-f179.google.com ([209.85.210.179]:33698)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>)
 id 1h9ZkP-0007Yr-7x; Thu, 28 Mar 2019 14:27:30 -0400
Received: by mail-pf1-f179.google.com with SMTP id i19so3100421pfd.0;
 Thu, 28 Mar 2019 11:27:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=L+yRucOARXpvxEcLC5wGXqpDRiJi4mgUAaDfD6VwGDE=;
 b=XxabST/aHaWMBeeJS+OCvaQAAeUP8TkJQW+//sTsi6WJ4vZccrH8qrOE8sAnn7GGoU
 RjqHL+a4mfzREnycbm89Q7ucuKrZNDC7FCAsdKuGaECTC/EstLjoYMHbLpfJdX5vThd6
 wjfzSWIba3gg2krNdjXaxs75Q4oTmA0S0qCXQP5vU/PuPO09PW/odJOj8UGsCCWD9Ksf
 d4DbFum3FmrqM7+a/a1FCj3QpnuAisAyF+u/pCV/nDtj9Hlc6DSuPitAPXZ26IS/9xmU
 Od1jdJyL+Tle4FODDUoSiGhkIFVwOBdyqiXcYcG7NwtK+lQrgBIy0WBZ7IE63kUuhrPa
 0hBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:to:cc:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=L+yRucOARXpvxEcLC5wGXqpDRiJi4mgUAaDfD6VwGDE=;
 b=Zt3RF4m88H7TdnqMt/IGv4kP5C37S2Luxi4hJtiW8J/5pL61iVd/j/NpO3llWkuihB
 RTx3N3Vw5EzPJtsPygAa51ZcPIoMhgixpuUYbeJjT5+WSZSfg4fOllayQywAAVcq4YU+
 5q9ISAt8dF78TIjolIFvFwDZO49M74/Vl0yzsZuQmggzFGa88v6gh8hShc+E8vSYi/dn
 8xLPLksFpp9Js9mUQL1mRVeUJCLGmHQ24W/S/PKgHk1pt8Mbmpzv4TY3K7Ya1qyZPL1P
 u6RC2oYVzd6DAeqgYMceT4gQPUblZ9TQnpm15GetWgcrqOGPO4b1tC/TCfKu0CEz2axc
 WTJA==
X-Gm-Message-State: APjAAAX3myEbnuPt/WzhZaAi6+wZv05IncF2eOpfIya7KIZuJ+t/9DZo
 Jhd+EeFZcTcisioTBoCkfrVQlqN7QfM=
X-Google-Smtp-Source: APXvYqyOB/+aPSf2qfwSE/XNskEWgWzxaanAD3GCMEuMgwhb77jdyiSnO+GQS8YkE2yDT2ozIR474g==
X-Received: by 2002:a63:943:: with SMTP id 64mr22862977pgj.448.1553797642822; 
 Thu, 28 Mar 2019 11:27:22 -0700 (PDT)
Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38])
 by smtp.googlemail.com with ESMTPSA id
 m25sm21670593pfa.175.2019.03.28.11.27.20
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 28 Mar 2019 11:27:21 -0700 (PDT)
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even in
 force mode
To: Nicolas Mailhot <nicolas.mailhot@HIDDEN>,
 L A Walsh <coreutils@HIDDEN>
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
 <20190301225157542680112@HIDDEN>
 <5f75590d-b567-5ae5-0d14-292acca04dbd@HIDDEN>
 <20190302122813076099305@HIDDEN> <5C7B930E.60409@HIDDEN>
 <012b412d-c9e1-741b-28af-c3245bfafec8@HIDDEN>
 <5C7BF766.7060907@HIDDEN> <2f1967383c371eba04ac73ac63c776ea@HIDDEN>
From: Assaf Gordon <assafgordon@HIDDEN>
Message-ID: <19f6157f-e3a4-4f6b-973b-5eeb357d93fe@HIDDEN>
Date: Thu, 28 Mar 2019 12:27:20 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.5.1
MIME-Version: 1.0
In-Reply-To: <2f1967383c371eba04ac73ac63c776ea@HIDDEN>
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: 34700
Cc: auerswal@HIDDEN, 34700 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 34700 notabug
severity 34700 wishlist
retitle: rm: add new --force option deal with read-only directories
stop

Hello,
As explained by several people in this thread,
This is not a bug in "rm -f", but the mandated behavior.

Bob and others provided work-arounds ( https://bugs.gnu.org/34700#17 ).

As for adding a new "--really-force" option
(https://bugs.gnu.org/34700#11) - I'm marking this as a wish-list
item.

-assaf









Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Mar 2019 07:43:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 04 02:43:41 2019
Received: from localhost ([127.0.0.1]:58912 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h0iGD-0007ZU-Br
	for submit <at> debbugs.gnu.org; Mon, 04 Mar 2019 02:43:41 -0500
Received: from eggs.gnu.org ([209.51.188.92]:35841)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <nicolas.mailhot@HIDDEN>) id 1h0iG8-0007ZE-Qh
 for submit <at> debbugs.gnu.org; Mon, 04 Mar 2019 02:43:39 -0500
Received: from lists.gnu.org ([209.51.188.17]:35821)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <nicolas.mailhot@HIDDEN>)
 id 1h0iG3-0005dX-E2
 for submit <at> debbugs.gnu.org; Mon, 04 Mar 2019 02:43:31 -0500
Received: from eggs.gnu.org ([209.51.188.92]:50216)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <nicolas.mailhot@HIDDEN>) id 1h0iG2-0006mQ-Ae
 for bug-coreutils@HIDDEN; Mon, 04 Mar 2019 02:43:31 -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.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 RCVD_IN_DNSWL_LOW,URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <nicolas.mailhot@HIDDEN>) id 1h0iG1-0005aH-80
 for bug-coreutils@HIDDEN; Mon, 04 Mar 2019 02:43:30 -0500
Received: from smtpoutz29.laposte.net ([194.117.213.104]:39365
 helo=smtp.laposte.net)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <nicolas.mailhot@HIDDEN>)
 id 1h0iG0-0005FH-Fz
 for bug-coreutils@HIDDEN; Mon, 04 Mar 2019 02:43:29 -0500
Received: from smtp.laposte.net (localhost [127.0.0.1])
 by lpn-prd-vrout017 (Postfix) with ESMTP id B1C8EBC00B3
 for <bug-coreutils@HIDDEN>; Mon,  4 Mar 2019 08:43:01 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=mail0;
 t=1551685381; bh=Ol25RO2dY9yxR1MPUDSwB/btAk6TeIZQpNDD+wExunU=;
 h=Date:From:To:Cc:Subject:In-Reply-To:References;
 b=UP/37kxsOqMxRlkyWbtuxtgRWdCNIZ+3RC48lTCf2u9o/dPBJfSCEYc2Ecr5TMigd
 iopf2ChLT3VzJ9Eh/1Wzd1hbXYEWB38jmNDVciYVAGtjUjgxRxZWcqjwH8F5kXqx15
 bDmeQ7M58bJvi5gK+KDkFss90Xp9wSksct0sp2yyfc+9pAd9lzjAJap3kpfnINKmG/
 kJlhZh0JRSFr6ogmeIbKVoFNohuYiAZIYhFT9c0u+qxB9c8KXAJm2BPF2G6y2E9ijJ
 FGlBycBH0ckVOdNPfZ72u+Xu8ngJjsf++vbQoYpfvp4cwoguFnmsGDR6q5hoxeHfYj
 oU6UYQxsU0FkA==
Received: from smtp.laposte.net (localhost [127.0.0.1])
 by lpn-prd-vrout017 (Postfix) with ESMTP id A5454BC0121
 for <bug-coreutils@HIDDEN>; Mon,  4 Mar 2019 08:43:01 +0100 (CET)
Received: from lpn-prd-vrin001 (lpn-prd-vrin001.laposte [10.128.63.2])
 by lpn-prd-vrout017 (Postfix) with ESMTP id A3A94BC00B3
 for <bug-coreutils@HIDDEN>; Mon,  4 Mar 2019 08:43:01 +0100 (CET)
Received: from lpn-prd-vrin001 (localhost [127.0.0.1])
 by lpn-prd-vrin001 (Postfix) with ESMTP id 8AAAD37361C
 for <bug-coreutils@HIDDEN>; Mon,  4 Mar 2019 08:43:01 +0100 (CET)
Received: from arekh.ddns.net (82-64-49-105.subs.proxad.net [82.64.49.105])
 by lpn-prd-vrin001 (Postfix) with ESMTPA id 3D27D3735C2;
 Mon,  4 Mar 2019 08:43:01 +0100 (CET)
Received: from arekh.ddns.net (arekh.okg [192.168.0.4])
 by arekh.ddns.net (Postfix) with ESMTPSA id 687AE220098;
 Mon,  4 Mar 2019 08:42:58 +0100 (CET)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Date: Mon, 04 Mar 2019 08:42:58 +0100
From: Nicolas Mailhot <nicolas.mailhot@HIDDEN>
To: L A Walsh <coreutils@HIDDEN>
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even in
 force mode
In-Reply-To: <5C7BF766.7060907@HIDDEN>
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
 <20190301225157542680112@HIDDEN>
 <5f75590d-b567-5ae5-0d14-292acca04dbd@HIDDEN>
 <20190302122813076099305@HIDDEN> <5C7B930E.60409@HIDDEN>
 <012b412d-c9e1-741b-28af-c3245bfafec8@HIDDEN>
 <5C7BF766.7060907@HIDDEN>
User-Agent: Roundcube Webmail/1.4-rc1
Message-ID: <2f1967383c371eba04ac73ac63c776ea@HIDDEN>
X-Sender: nicolas.mailhot@HIDDEN
X-VR-FullState: 0
X-VR-Score: -100
X-VR-Cause-1: gggruggvucftvghtrhhoucdtuddrgedutddrfedtgdduuddtucetufdoteggodetrfdotffvucfrrhho
X-VR-Cause-2: fhhilhgvmecunfetrffquffvgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhht
X-VR-Cause-3: shculddquddttddmnecujfgurhepgggtgfffhffvufgjfhgfkfigsehtkehjtddtreejnecuhfhrohhm
X-VR-Cause-4: pefpihgtohhlrghsucforghilhhhohhtuceonhhitgholhgrshdrmhgrihhlhhhotheslhgrphhoshht
X-VR-Cause-5: vgdrnhgvtheqnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghholhgrnhhgrdhorhhgnecukfhp
X-VR-Cause-6: peekvddrieegrdegledruddtheenucfrrghrrghmpehmohguvgepshhmthhpohhuthdpihhnvghtpeek
X-VR-Cause-7: vddrieegrdegledruddthedphhgvlhhopegrrhgvkhhhrdguughnshdrnhgvthdpmhgrihhlfhhrohhm
X-VR-Cause-8: pehnihgtohhlrghsrdhmrghilhhhohhtsehlrghpohhsthgvrdhnvghtpdhrtghpthhtohepsghughdq
X-VR-Cause-9: tghorhgvuhhtihhlshesghhnuhdrohhrghdprhgtphhtthhopegtohhrvghuthhilhhssehtlhhinhig
X-VR-Cause-10: rdhorhhgpdhrtghpthhtoheprghuvghrshifrghlsehunhhigidqrghgrdhunhhiqdhklhdruggvnecu
X-VR-Cause-11: vehluhhsthgvrhfuihiivgeptd
X-VR-AvState: No
X-VR-State: 0
X-VR-State: 0
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 194.117.213.104
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: Erik Auerswald <auerswal@HIDDEN>,
 Coreutils <bug-coreutils@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

Le 2019-03-03 16:48, L A Walsh a =C3=A9crit=C2=A0:
> On 3/3/2019 4:43 AM, Erik Auerswald wrote:
>> Hi,
>>=20
>> On 3/3/19 09:40, L A Walsh wrote:
>>=20
>>> On 3/2/2019 11:31 AM, Bob Proulx wrote:
>>>=20
>>>> But regardless of that it does not change the fact that the entire
>>>> purpose of read-only directories is to prevent removing and renaming
>>>> of files within them.
>>>>=20
>>>>=20
>>> ----
>>>      But not by the user owning them.
>>>=20
>>=20
>> The rationale given by the Go developers is to prevent downloaded test
>> code to remove or alter files in the modules directory, not to prevent
>> the user from doing that.
>>=20
> ----
>     I'm not familiar w/go, or why the user wants to purge something
> that sounded equivalent to a web-cache, vs. the local extension-source
> storage.

The user (me) just wants to clean up files in his own home directory=20
without special complications.

>> The Go developers implemented "go clean -modcache" for that purpose.
>> https://github.com/golang/go/issues/27161#issuecomment-415213240
>> https://tip.golang.org/cmd/go/#hdr-Remove_object_files_and_cached_file=
s

And having files that need special commands to be modified is quite=20
umconfortable

Not to mention the command may have been uninstalled leaving files on=20
disk, is quite new, buggy, and full of unnexpected side effects (because=20
it would have been too much to ask for a command that "just" cleans up=20
the cache).

> ----
>     If there is a utilities for what the user needs, why are they=20
> wanting
> 'rm' to do it?  Is it just that they don't know about the util, or
> maybe  the
> util has constraints on its use to delete the source if the cached=20
> version
> is deleted?  I don't know.  I do know that Google isn't known for=20
> following
> common sense standards and like to force its own way on people, so I=20
> don't
> know why the util isn't "working" for the original poster.

It isn't "working". Besides the ro mode is not supposed to protect the=20
files from users, it's supposed to protect the cache files from go unit=20
tests, because google has moved go resources from plain directories to=20
zip files, and code that attempts to manipulate zip files as if they=20
were directories fails badly

As one of the Go devs commented in one of the tickets after arguing for=20
the ro change "I'm surprised rm is not smart enough to do the right=20
thing" (meaning remove everything when asked without requiring a=20
permission change, since the user owns everything)

Regards,

--=20
Nicolas Mailhot




Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Mar 2019 15:54:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 03 10:54:37 2019
Received: from localhost ([127.0.0.1]:58646 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h0TRl-0003eq-H1
	for submit <at> debbugs.gnu.org; Sun, 03 Mar 2019 10:54:37 -0500
Received: from eggs.gnu.org ([209.51.188.92]:45983)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1h0TRj-0003ec-B9
 for submit <at> debbugs.gnu.org; Sun, 03 Mar 2019 10:54:35 -0500
Received: from lists.gnu.org ([209.51.188.17]:60148)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <coreutils@HIDDEN>) id 1h0TRe-0002qy-4D
 for submit <at> debbugs.gnu.org; Sun, 03 Mar 2019 10:54:30 -0500
Received: from eggs.gnu.org ([209.51.188.92]:60205)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <coreutils@HIDDEN>) id 1h0TRZ-0003ku-Hh
 for bug-coreutils@HIDDEN; Sun, 03 Mar 2019 10:54:29 -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.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <coreutils@HIDDEN>) id 1h0TNj-0000Pg-SA
 for bug-coreutils@HIDDEN; Sun, 03 Mar 2019 10:50:29 -0500
Received: from ishtar.tlinx.org ([173.164.175.65]:34334
 helo=Ishtar.sc.tlinx.org)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <coreutils@HIDDEN>) id 1h0TNj-0000Nf-Gf
 for bug-coreutils@HIDDEN; Sun, 03 Mar 2019 10:50:27 -0500
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 x23FoLlr033936; Sun, 3 Mar 2019 07:50:24 -0800
Message-ID: <5C7BF766.7060907@HIDDEN>
Date: Sun, 03 Mar 2019 07:48:54 -0800
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird
MIME-Version: 1.0
To: Coreutils <bug-coreutils@HIDDEN>
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even
 in force mode
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
 <20190301225157542680112@HIDDEN>
 <5f75590d-b567-5ae5-0d14-292acca04dbd@HIDDEN>
 <20190302122813076099305@HIDDEN> <5C7B930E.60409@HIDDEN>
 <012b412d-c9e1-741b-28af-c3245bfafec8@HIDDEN>
In-Reply-To: <012b412d-c9e1-741b-28af-c3245bfafec8@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
 timestamps) [generic]
X-Received-From: 173.164.175.65
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
Cc: Erik Auerswald <auerswal@HIDDEN>, nicolas.mailhot@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 3/3/2019 4:43 AM, Erik Auerswald wrote:
> Hi,
>
> On 3/3/19 09:40, L A Walsh wrote:
>   
>> On 3/2/2019 11:31 AM, Bob Proulx wrote:
>>     
>>> But regardless of that it does not change the fact that the entire
>>> purpose of read-only directories is to prevent removing and renaming
>>> of files within them.
>>>    
>>>       
>> ----
>>      But not by the user owning them.
>>     
>
> The rationale given by the Go developers is to prevent downloaded test
> code to remove or alter files in the modules directory, not to prevent
> the user from doing that.
>   
----
    I'm not familiar w/go, or why the user wants to purge something
that sounded equivalent to a web-cache, vs. the local extension-source
storage.

> The Go developers implemented "go clean -modcache" for that purpose.
> https://github.com/golang/go/issues/27161#issuecomment-415213240
> https://tip.golang.org/cmd/go/#hdr-Remove_object_files_and_cached_files
>   
----
    If there is a utilities for what the user needs, why are they wanting
'rm' to do it?  Is it just that they don't know about the util, or
maybe  the
util has constraints on its use to delete the source if the cached version
is deleted?  I don't know.  I do know that Google isn't known for following
common sense standards and like to force its own way on people, so I don't
know why the util isn't "working" for the original poster. 
> I concur to let software handle repetitive tasks.
----
    That's one of the reasons I got into computer SW development to
begin with.  I wanted to be able to program the computer to automatically
do the things I'd normally have to do manually.


> If cleaning the cache occurs all the time, using "go cache -modcache"
> (or whatever program is appropriate for the specific cache) should be
> the routine used. If there is no specialized program provided yet, a
> script could be developed for that purpose.
>   
----
    Well, that's might be the rub -- the current cache-cleaning program may
not be doing things "when" and "how" the user wants (I don't know).  Even
if there is a specialized program that provides one way to clean a cache,
that doesn't mean it works for the original user.  Another possibility is
that they might want to delete only files meeting some specific criteria. If
the provided tool doesn't do what they want or does "too much", they may
want to have their own way of cleaning things up.

    I've had more than one process that existed and worked well for me
before
google got involved.  My over-active imagination can easily come up with
situations and possibilities where the user might prefer their own controls
in place.

Cheers,
Linda





Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Mar 2019 12:44:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 03 07:44:27 2019
Received: from localhost ([127.0.0.1]:58131 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h0QTj-00054t-Ct
	for submit <at> debbugs.gnu.org; Sun, 03 Mar 2019 07:44:27 -0500
Received: from eggs.gnu.org ([209.51.188.92]:41998)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <auerswal@HIDDEN>) id 1h0QTh-00054g-3v
 for submit <at> debbugs.gnu.org; Sun, 03 Mar 2019 07:44:25 -0500
Received: from lists.gnu.org ([209.51.188.17]:53849)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <auerswal@HIDDEN>)
 id 1h0QTZ-0008BG-Dl
 for submit <at> debbugs.gnu.org; Sun, 03 Mar 2019 07:44:18 -0500
Received: from eggs.gnu.org ([209.51.188.92]:56377)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <auerswal@HIDDEN>) id 1h0QTY-0000np-Ad
 for bug-coreutils@HIDDEN; Sun, 03 Mar 2019 07:44:17 -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.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <auerswal@HIDDEN>) id 1h0QTX-00089q-Bl
 for bug-coreutils@HIDDEN; Sun, 03 Mar 2019 07:44:16 -0500
Received: from mailgw1.uni-kl.de ([2001:638:208:120::220]:41656)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <auerswal@HIDDEN>)
 id 1h0QTT-00084a-Sh
 for bug-coreutils@HIDDEN; Sun, 03 Mar 2019 07:44:14 -0500
Received: from [172.20.10.2] (x2f7fced.dyn.telefonica.de [2.247.252.237])
 (authenticated bits=0)
 by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id
 x23ChrIt021689
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <bug-coreutils@HIDDEN>; Sun, 3 Mar 2019 13:44:05 +0100
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even in
 force mode
To: bug-coreutils@HIDDEN
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
 <20190301225157542680112@HIDDEN>
 <5f75590d-b567-5ae5-0d14-292acca04dbd@HIDDEN>
 <20190302122813076099305@HIDDEN> <5C7B930E.60409@HIDDEN>
From: Erik Auerswald <auerswal@HIDDEN>
Message-ID: <012b412d-c9e1-741b-28af-c3245bfafec8@HIDDEN>
Date: Sun, 3 Mar 2019 13:43:49 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.5.1
MIME-Version: 1.0
In-Reply-To: <5C7B930E.60409@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-GB
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:638:208:120::220
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On 3/3/19 09:40, L A Walsh wrote:
> On 3/2/2019 11:31 AM, Bob Proulx wrote:
>> But regardless of that it does not change the fact that the entire
>> purpose of read-only directories is to prevent removing and renaming
>> of files within them.
>>    
> ----
>      But not by the user owning them.

The rationale given by the Go developers is to prevent downloaded test
code to remove or alter files in the modules directory, not to prevent
the user from doing that.

> [...]
>>> I would suggest people with specific directories that inhibit deletion of
>>> files inside although they should not (e.g. a "cache") to deliberatly change
>>> the permissions of said directories prior to deleting files inside. Using a
>>> script like the above, even without the basic mistakes in the script, is
>>> quite dangerous.
>>>      
> Yeah...I wouldn't do it, I'd write a script that invokes the app and
> clears out the cache dir when the app exits if it bothered me enough.

The Go developers implemented "go clean -modcache" for that purpose.
https://github.com/golang/go/issues/27161#issuecomment-415213240
https://tip.golang.org/cmd/go/#hdr-Remove_object_files_and_cached_files

> Much better to let the computer do the repetitive deletions.  If I do it
> manually, it increases the chances of me creating a problem the more often
> I do it.
> 
> Really -- scripts are much better at handling redundant/routine matters that
> turn parts of my brain off.  OTOH, some people are better at redundant
> detail
> and don't suffer the same problems I would.  People are different.

I concur to let software handle repetitive tasks.

If cleaning the cache occurs seldom, manually performing the changes, or
better invoking an existing specialized program (or script) for this
specific cache seems to be better than circumventing the safety net in a
general purpose utility. Especially if this circumvention means
transparently changing access rights on a directory that is not
mentioned in the utility invocation.

If cleaning the cache occurs all the time, using "go cache -modcache"
(or whatever program is appropriate for the specific cache) should be
the routine used. If there is no specialized program provided yet, a
script could be developed for that purpose.

Thanks,
Erik




Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Mar 2019 08:41:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 03 03:41:54 2019
Received: from localhost ([127.0.0.1]:58074 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h0Mh0-0005hq-CK
	for submit <at> debbugs.gnu.org; Sun, 03 Mar 2019 03:41:54 -0500
Received: from eggs.gnu.org ([209.51.188.92]:38959)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1h0Mgx-0005ha-Cw
 for submit <at> debbugs.gnu.org; Sun, 03 Mar 2019 03:41:51 -0500
Received: from lists.gnu.org ([209.51.188.17]:43851)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <coreutils@HIDDEN>) id 1h0Mgr-0008RC-Vi
 for submit <at> debbugs.gnu.org; Sun, 03 Mar 2019 03:41:46 -0500
Received: from eggs.gnu.org ([209.51.188.92]:53341)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <coreutils@HIDDEN>) id 1h0Mgr-000264-7R
 for bug-coreutils@HIDDEN; Sun, 03 Mar 2019 03:41:45 -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.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <coreutils@HIDDEN>) id 1h0Mgq-0008Q4-E5
 for bug-coreutils@HIDDEN; Sun, 03 Mar 2019 03:41:45 -0500
Received: from ishtar.tlinx.org ([173.164.175.65]:45308
 helo=Ishtar.sc.tlinx.org)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <coreutils@HIDDEN>) id 1h0Mgq-0008N6-3Z
 for bug-coreutils@HIDDEN; Sun, 03 Mar 2019 03:41:44 -0500
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 x238fdfW041251
 for <bug-coreutils@HIDDEN>; Sun, 3 Mar 2019 00:41:41 -0800
Message-ID: <5C7B930E.60409@HIDDEN>
Date: Sun, 03 Mar 2019 00:40:46 -0800
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird
MIME-Version: 1.0
To: bug-coreutils@HIDDEN
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even
 in force mode
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
 <20190301225157542680112@HIDDEN>
 <5f75590d-b567-5ae5-0d14-292acca04dbd@HIDDEN>
 <20190302122813076099305@HIDDEN>
In-Reply-To: <20190302122813076099305@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
 timestamps) [generic]
X-Received-From: 173.164.175.65
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 3/2/2019 11:31 AM, Bob Proulx wrote:
> But regardless of that it does not change the fact that the entire
> purpose of read-only directories is to prevent removing and renaming
> of files within them.
>   
----
    But not by the user owning them.  I don't remember the last time I used
chmod -w to prevent myself from deleting all the files in a directory. 
I use
it to prevent other people from removing/renaming.  If I want to
give myself "pause", I'll set them to immutable (on linux) and chmod
read-only or system on windows -- both of those give some pause to the
standard flow.  

    But read-only and owned by me, takes about an extra 1-2 seconds as
I tack sudo on the front and run right over user perms.

>   
>> I would suggest people with specific directories that inhibit deletion of
>> files inside although they should not (e.g. a "cache") to deliberatly change
>> the permissions of said directories prior to deleting files inside. Using a
>> script like the above, even without the basic mistakes in the script, is
>> quite dangerous.
>>     
Yeah...I wouldn't do it, I'd write a script that invokes the app and
clears out the cache dir when the app exits if it bothered me enough.

Much better to let the computer do the repetitive deletions.  If I do it
manually, it increases the chances of me creating a problem the more often
I do it. 

Really -- scripts are much better at handling redundant/routine matters that
turn parts of my brain off.  OTOH, some people are better at redundant
detail
and don't suffer the same problems I would.  People are different.
>   




Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Mar 2019 19:31:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 02 14:31:54 2019
Received: from localhost ([127.0.0.1]:57878 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h0AMT-0001j2-Nr
	for submit <at> debbugs.gnu.org; Sat, 02 Mar 2019 14:31:53 -0500
Received: from eggs.gnu.org ([209.51.188.92]:49529)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bob@HIDDEN>) id 1h0AMR-0001iq-FB
 for submit <at> debbugs.gnu.org; Sat, 02 Mar 2019 14:31:52 -0500
Received: from lists.gnu.org ([209.51.188.17]:52335)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <bob@HIDDEN>) id 1h0AMM-0007es-8T
 for submit <at> debbugs.gnu.org; Sat, 02 Mar 2019 14:31:46 -0500
Received: from eggs.gnu.org ([209.51.188.92]:35678)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <bob@HIDDEN>) id 1h0AML-0000Zc-DL
 for bug-coreutils@HIDDEN; Sat, 02 Mar 2019 14:31:46 -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.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <bob@HIDDEN>) id 1h0AMK-0007eF-Ql
 for bug-coreutils@HIDDEN; Sat, 02 Mar 2019 14:31:45 -0500
Received: from havoc.proulx.com ([96.88.95.61]:34770)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <bob@HIDDEN>) id 1h0AMK-0007cm-K4
 for bug-coreutils@HIDDEN; Sat, 02 Mar 2019 14:31:44 -0500
Received: from joseki.proulx.com (localhost [127.0.0.1])
 by havoc.proulx.com (Postfix) with ESMTP id 2ADB649D
 for <bug-coreutils@HIDDEN>; Sat,  2 Mar 2019 12:31:43 -0700 (MST)
Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119])
 by joseki.proulx.com (Postfix) with ESMTP id 0EE0321243
 for <bug-coreutils@HIDDEN>; Sat,  2 Mar 2019 12:31:42 -0700 (MST)
Received: by hysteria.proulx.com (Postfix, from userid 1000)
 id 0429D2DC7C; Sat,  2 Mar 2019 12:31:41 -0700 (MST)
Date: Sat, 2 Mar 2019 12:31:41 -0700
From: Bob Proulx <bob@HIDDEN>
To: bug-coreutils@HIDDEN
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even in
 force mode
Message-ID: <20190302122813076099305@HIDDEN>
Mail-Followup-To: bug-coreutils@HIDDEN
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
 <20190301225157542680112@HIDDEN>
 <5f75590d-b567-5ae5-0d14-292acca04dbd@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5f75590d-b567-5ae5-0d14-292acca04dbd@HIDDEN>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 96.88.95.61
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

Erik Auerswald wrote:
> Bob Proulx wrote:
> > However regardless of intentions and design if one really wants to
> > smash it then this is easily scripted.  No code modifications are
> > needed.
> > 
> >    #!/bin/sh
> >    chmod -R u+w $1
> >    rm -rf $1
> 
> To everyone considering the above "script": do not use it! It does not even
> guard against spaces in file names. Besides being dangerously buggy, it does
> not even solve the problem of deleting a file inside a read-only directory.

Obviously I typed that in extemporaneously on the spur of the moment.
I should have put an "untested" tag upon it.

But regardless of that it does not change the fact that the entire
purpose of read-only directories is to prevent removing and renaming
of files within them.

> I would suggest people with specific directories that inhibit deletion of
> files inside although they should not (e.g. a "cache") to deliberatly change
> the permissions of said directories prior to deleting files inside. Using a
> script like the above, even without the basic mistakes in the script, is
> quite dangerous.

I don't think we are in disagreement here.

Bob




Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Mar 2019 18:03:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 02 13:03:12 2019
Received: from localhost ([127.0.0.1]:57845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1h08ye-00083g-Je
	for submit <at> debbugs.gnu.org; Sat, 02 Mar 2019 13:03:12 -0500
Received: from eggs.gnu.org ([209.51.188.92]:60865)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <auerswal@HIDDEN>) id 1h08yd-00083T-Em
 for submit <at> debbugs.gnu.org; Sat, 02 Mar 2019 13:03:11 -0500
Received: from lists.gnu.org ([209.51.188.17]:58338)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <auerswal@HIDDEN>)
 id 1h08yX-0007O4-D9
 for submit <at> debbugs.gnu.org; Sat, 02 Mar 2019 13:03:06 -0500
Received: from eggs.gnu.org ([209.51.188.92]:46909)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <auerswal@HIDDEN>) id 1h08yW-0001OE-GK
 for bug-coreutils@HIDDEN; Sat, 02 Mar 2019 13:03:05 -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.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <auerswal@HIDDEN>) id 1h08pU-0006oQ-VG
 for bug-coreutils@HIDDEN; Sat, 02 Mar 2019 12:53:45 -0500
Received: from mailgw1.uni-kl.de ([2001:638:208:120::220]:56924)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <auerswal@HIDDEN>)
 id 1h08pU-0005rq-JH
 for bug-coreutils@HIDDEN; Sat, 02 Mar 2019 12:53:44 -0500
Received: from [172.20.10.2] (x52716292.dyn.telefonica.de [82.113.98.146])
 (authenticated bits=0)
 by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id
 x22HrLtr004456
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <bug-coreutils@HIDDEN>; Sat, 2 Mar 2019 18:53:31 +0100
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even in
 force mode
To: bug-coreutils@HIDDEN
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
 <20190301225157542680112@HIDDEN>
From: Erik Auerswald <auerswal@HIDDEN>
Message-ID: <5f75590d-b567-5ae5-0d14-292acca04dbd@HIDDEN>
Date: Sat, 2 Mar 2019 18:53:20 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.5.1
MIME-Version: 1.0
In-Reply-To: <20190301225157542680112@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-GB
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:638:208:120::220
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On 3/2/19 07:18, Bob Proulx wrote:
> Nicolas Mailhot wrote:
>> For their own reasons, the Go maintainers have decided the user Go cache
>> will now be read-only.
>> https://github.com/golang/go/issues/27161#issuecomment-433098406
>> That means cleaning up cache artefacts with rm does not work anymore
>> https://github.com/golang/go/issues/30502
> [...]
> However regardless of intentions and design if one really wants to
> smash it then this is easily scripted.  No code modifications are
> needed.
> 
>    #!/bin/sh
>    chmod -R u+w $1
>    rm -rf $1

To everyone considering the above "script": do not use it! It does not 
even guard against spaces in file names. Besides being dangerously 
buggy, it does not even solve the problem of deleting a file inside a 
read-only directory.

I would suggest people with specific directories that inhibit deletion 
of files inside although they should not (e.g. a "cache") to deliberatly 
change the permissions of said directories prior to deleting files 
inside. Using a script like the above, even without the basic mistakes 
in the script, is quite dangerous.

Thanks,
Erik




Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at 34700 <at> debbugs.gnu.org:


Received: (at 34700) by debbugs.gnu.org; 2 Mar 2019 06:18:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 02 01:18:53 2019
Received: from localhost ([127.0.0.1]:56938 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gzxz2-0007iW-AC
	for submit <at> debbugs.gnu.org; Sat, 02 Mar 2019 01:18:53 -0500
Received: from havoc.proulx.com ([96.88.95.61]:39550)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bob@HIDDEN>) id 1gzxyz-0007iJ-Jr
 for 34700 <at> debbugs.gnu.org; Sat, 02 Mar 2019 01:18:50 -0500
Received: from joseki.proulx.com (localhost [127.0.0.1])
 by havoc.proulx.com (Postfix) with ESMTP id 643AE3CF;
 Fri,  1 Mar 2019 23:18:43 -0700 (MST)
Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119])
 by joseki.proulx.com (Postfix) with ESMTP id 1011D21241;
 Fri,  1 Mar 2019 23:18:43 -0700 (MST)
Received: by hysteria.proulx.com (Postfix, from userid 1000)
 id E32742DC7C; Fri,  1 Mar 2019 23:18:42 -0700 (MST)
Date: Fri, 1 Mar 2019 23:18:42 -0700
From: Bob Proulx <bob@HIDDEN>
To: Nicolas Mailhot <nicolas.mailhot@HIDDEN>
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even in
 force mode
Message-ID: <20190301225157542680112@HIDDEN>
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 34700
Cc: 34700 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Nicolas Mailhot wrote:
> For their own reasons, the Go maintainers have decided the user Go cache
> will now be read-only.
> https://github.com/golang/go/issues/27161#issuecomment-433098406

Not wise.

> That means cleaning up cache artefacts with rm does not work anymore
> https://github.com/golang/go/issues/30502

Users count upon non-writable directories to prevent files from being
deleted.  I am confident that changing rm to delete contents of
non-writable directories would produce bug reports.  And worse it
would have resulted in data loss in those cases.  Weigh data loss
against inconvenience intentionally created.

They have intentionally done this to prevent actions such as rm -rf on
the path.  That is the entire purpose of making directories read-only,
to prevent the contents from being removed or renamed.

However regardless of intentions and design if one really wants to
smash it then this is easily scripted.  No code modifications are
needed.

  #!/bin/sh
  chmod -R u+w $1
  rm -rf $1

Bob




Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at 34700 <at> debbugs.gnu.org:


Received: (at 34700) by debbugs.gnu.org; 1 Mar 2019 14:46:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 01 09:46:33 2019
Received: from localhost ([127.0.0.1]:55976 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gzjQm-00056X-NO
	for submit <at> debbugs.gnu.org; Fri, 01 Mar 2019 09:46:33 -0500
Received: from mx1.redhat.com ([209.132.183.28]:51268)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eblake@HIDDEN>) id 1gzjQj-00056H-J9
 for 34700 <at> debbugs.gnu.org; Fri, 01 Mar 2019 09:46:30 -0500
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com
 [10.5.11.16])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.redhat.com (Postfix) with ESMTPS id AA128316F003;
 Fri,  1 Mar 2019 14:46:23 +0000 (UTC)
Received: from [10.3.116.222] (ovpn-116-222.phx2.redhat.com [10.3.116.222])
 by smtp.corp.redhat.com (Postfix) with ESMTPS id 637065C1B5;
 Fri,  1 Mar 2019 14:46:23 +0000 (UTC)
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even in
 force mode
To: Nicolas Mailhot <nicolas.mailhot@HIDDEN>, 34700 <at> debbugs.gnu.org
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
 <a5c61374-a397-2230-f8c3-df4d764fd52f@HIDDEN>
 <84755e8bbcf3b565142b0c5c58f1b8d9b79e812c.camel@HIDDEN>
From: Eric Blake <eblake@HIDDEN>
Organization: Red Hat, Inc.
Message-ID: <83662bea-b11f-f6a8-d548-ed674940bff0@HIDDEN>
Date: Fri, 1 Mar 2019 08:46:22 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.5.0
MIME-Version: 1.0
In-Reply-To: <84755e8bbcf3b565142b0c5c58f1b8d9b79e812c.camel@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (mx1.redhat.com [10.5.110.41]); Fri, 01 Mar 2019 14:46:23 +0000 (UTC)
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 34700
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

On 3/1/19 8:14 AM, Nicolas Mailhot wrote:
> Le vendredi 01 mars 2019 à 07:58 -0600, Eric Blake a écrit :
>>
>> The behavior of -f is specified by POSIX:
>> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html
>>
>> and is specified to suppress prompts and avoid diagnostics on missing
>> files, but NOT a means to force deletion via changing directory
>> permissions.  For that, you'd need a new option, because we can't
>> change
>> the long-specified meaning of -f without breaking scripts.
> 
> Well it seems people got spoiled by other OSes where read-only is not-
> really-read-only-when-you-own-the-file (IIRC vi also ignores permissions
> in force mode).
> 
> So could a really-force flag be added?

Remember, unlink() requires write permissions on the container
directory. If a directory is read-only, unlink() alone CANNOT remove a
file, no matter who owns it (and that is true for ALL operating
systems). Unlinking a read-only file from a writable directory is
different than attempting to unlink from a read-only directory.

If rm is taught a new option to temporarily chmod() a directory to be
writable, just to perform the unlink(), should it then chmod() the
directory back to its original state or leave it writable when complete?
 What do you do about races (now that you are asking for a sequence of 2
or 3 syscalls instead of one, you have to worry about interactions with
another process also trying to cause you TOCTTOU security bugs)?  And
since such an option would be new, where you have to wait for new-enough
rm to be available in your distro, vs. the fact that you can already now
portably do a two-step chmod before rm.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at 34700 <at> debbugs.gnu.org:


Received: (at 34700) by debbugs.gnu.org; 1 Mar 2019 14:14:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 01 09:14:49 2019
Received: from localhost ([127.0.0.1]:55951 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gziw5-0004LH-Ff
	for submit <at> debbugs.gnu.org; Fri, 01 Mar 2019 09:14:49 -0500
Received: from smtpoutz24.laposte.net ([194.117.213.99]:37686
 helo=smtp.laposte.net) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <nicolas.mailhot@HIDDEN>) id 1gziw3-0004L8-1i
 for 34700 <at> debbugs.gnu.org; Fri, 01 Mar 2019 09:14:48 -0500
Received: from smtp.laposte.net (localhost [127.0.0.1])
 by lpn-prd-vrout012 (Postfix) with ESMTP id 81AE41632B6
 for <34700 <at> debbugs.gnu.org>; Fri,  1 Mar 2019 15:14:45 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=mail0;
 t=1551449685; bh=9CAc23mrcguY+U1y8J1gwaHHv7DBzrxmj/Sv7Kq7CVw=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=PADIqBj1twuP2O4HOv7ICTJGGSF2yY0hPD5aPizj58eoJeL6/MaJZKxbXjAbhpVKc
 akGG+DcwbSRm3jMR/ouKxCN8T2wxcGSlZbNfU8fC0YJzlZYdt82SXyViw+X9NL5RPk
 PUCslJwojWnNmpea5o62NSunaj/jI431FdwIqMC/SY/+ArVic63Glt6L3+Lto/wy/6
 lFKi0JW4ZgZja+TpTYTG3NCfsnJUJrPQlqH1/zfhshV+MeusJWZhZeN3R7cFAwBd0C
 fEp9h4ID54iqpwD6IP9rSAyZGpBQpCckFo1xzWcfNFWxHKhyPR1j1GXQND2jbiaQwU
 zUER2PDCUEBGw==
Received: from smtp.laposte.net (localhost [127.0.0.1])
 by lpn-prd-vrout012 (Postfix) with ESMTP id 77AD31631B9
 for <34700 <at> debbugs.gnu.org>; Fri,  1 Mar 2019 15:14:45 +0100 (CET)
Received: from lpn-prd-vrin001 (lpn-prd-vrin001.prosodie [10.128.63.2])
 by lpn-prd-vrout012 (Postfix) with ESMTP id 72880163136
 for <34700 <at> debbugs.gnu.org>; Fri,  1 Mar 2019 15:14:45 +0100 (CET)
Received: from lpn-prd-vrin001 (localhost [127.0.0.1])
 by lpn-prd-vrin001 (Postfix) with ESMTP id 60C9637360F
 for <34700 <at> debbugs.gnu.org>; Fri,  1 Mar 2019 15:14:45 +0100 (CET)
Received: from arekh.ddns.net (82-64-49-105.subs.proxad.net [82.64.49.105])
 by lpn-prd-vrin001 (Postfix) with ESMTPA id 498373735F2;
 Fri,  1 Mar 2019 15:14:45 +0100 (CET)
Received: from cerebro.okg (box.okg [192.168.0.1])
 by arekh.ddns.net (Postfix) with ESMTPSA id 2D1A12202F9;
 Fri,  1 Mar 2019 15:14:43 +0100 (CET)
Message-ID: <84755e8bbcf3b565142b0c5c58f1b8d9b79e812c.camel@HIDDEN>
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even
 in force mode
From: Nicolas Mailhot <nicolas.mailhot@HIDDEN>
To: Eric Blake <eblake@HIDDEN>, 34700 <at> debbugs.gnu.org
Date: Fri, 01 Mar 2019 15:14:43 +0100
In-Reply-To: <a5c61374-a397-2230-f8c3-df4d764fd52f@HIDDEN>
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
 <a5c61374-a397-2230-f8c3-df4d764fd52f@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.31.91 (3.31.91-1.fc30) 
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-VR-FullState: 0
X-VR-Score: -100
X-VR-Cause-1: gggruggvucftvghtrhhoucdtuddrgedutddrvdehgdeitdcutefuodetggdotefrodftvfcurfhrohhf
X-VR-Cause-2: ihhlvgemucfntefrqffuvffgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhs
X-VR-Cause-3: ucdlqddutddtmdenucfjughrpefkuffhvfffjghftggfggfgsehtkeertddtreejnecuhfhrohhmpefp
X-VR-Cause-4: ihgtohhlrghsucforghilhhhohhtuceonhhitgholhgrshdrmhgrihhlhhhotheslhgrphhoshhtvgdr
X-VR-Cause-5: nhgvtheqnecuffhomhgrihhnpehophgvnhhgrhhouhhprdhorhhgnecukfhppeekvddrieegrdegledr
X-VR-Cause-6: uddtheenucfrrghrrghmpehmohguvgepshhmthhpohhuthdpihhnvghtpeekvddrieegrdegledruddt
X-VR-Cause-7: hedphhgvlhhopegrrhgvkhhhrdguughnshdrnhgvthdpmhgrihhlfhhrohhmpehnihgtohhlrghsrdhm
X-VR-Cause-8: rghilhhhohhtsehlrghpohhsthgvrdhnvghtpdhrtghpthhtohepfeegjedttdesuggvsggsuhhgshdr
X-VR-Cause-9: ghhnuhdrohhrghdprhgtphhtthhopegvsghlrghkvgesrhgvughhrghtrdgtohhmnecuvehluhhsthgv
X-VR-Cause-10: rhfuihiivgeptd
X-VR-AvState: No
X-VR-State: 0
X-VR-State: 0
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 34700
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Le vendredi 01 mars 2019 à 07:58 -0600, Eric Blake a écrit :
> 
> The behavior of -f is specified by POSIX:
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html
> 
> and is specified to suppress prompts and avoid diagnostics on missing
> files, but NOT a means to force deletion via changing directory
> permissions.  For that, you'd need a new option, because we can't
> change
> the long-specified meaning of -f without breaking scripts.

Well it seems people got spoiled by other OSes where read-only is not-
really-read-only-when-you-own-the-file (IIRC vi also ignores permissions
in force mode).

So could a really-force flag be added?

Regards,

-- 
Nicolas Mailhot





Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at 34700 <at> debbugs.gnu.org:


Received: (at 34700) by debbugs.gnu.org; 1 Mar 2019 13:58:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 01 08:58:50 2019
Received: from localhost ([127.0.0.1]:55941 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gzigZ-0003xs-FC
	for submit <at> debbugs.gnu.org; Fri, 01 Mar 2019 08:58:49 -0500
Received: from mx1.redhat.com ([209.132.183.28]:51506)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eblake@HIDDEN>) id 1gzigX-0003xf-7O
 for 34700 <at> debbugs.gnu.org; Fri, 01 Mar 2019 08:58:45 -0500
Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com
 [10.5.11.13])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.redhat.com (Postfix) with ESMTPS id 46EEF317FC2D;
 Fri,  1 Mar 2019 13:58:39 +0000 (UTC)
Received: from [10.3.116.222] (ovpn-116-222.phx2.redhat.com [10.3.116.222])
 by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C9B9608C8;
 Fri,  1 Mar 2019 13:58:38 +0000 (UTC)
Subject: Re: bug#34700: rm refuses to remove files owned by the user, even in
 force mode
To: Nicolas Mailhot <nicolas.mailhot@HIDDEN>, 34700 <at> debbugs.gnu.org
References: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
From: Eric Blake <eblake@HIDDEN>
Organization: Red Hat, Inc.
Message-ID: <a5c61374-a397-2230-f8c3-df4d764fd52f@HIDDEN>
Date: Fri, 1 Mar 2019 07:58:38 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.5.0
MIME-Version: 1.0
In-Reply-To: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (mx1.redhat.com [10.5.110.41]); Fri, 01 Mar 2019 13:58:39 +0000 (UTC)
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 34700
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

On 3/1/19 6:48 AM, Nicolas Mailhot wrote:
> Hi,
> 
> For their own reasons, the Go maintainers have decided the user Go cache
> will now be read-only.
> https://github.com/golang/go/issues/27161#issuecomment-433098406
> 
> That means cleaning up cache artefacts with rm does not work anymore
> https://github.com/golang/go/issues/30502
> 
> I understand the need to protect read only files (even though they're
> supposed to have been created by a user decision, not by user-hostile
> tools). However should not rm remove the files anyway in force (-f) mode
> without an explicit chmod first? Do it without bothering me is why -f
> exists after all.

The behavior of -f is specified by POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html

and is specified to suppress prompts and avoid diagnostics on missing
files, but NOT a means to force deletion via changing directory
permissions.  For that, you'd need a new option, because we can't change
the long-specified meaning of -f without breaking scripts.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




Information forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Mar 2019 13:37:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 01 08:37:17 2019
Received: from localhost ([127.0.0.1]:55916 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gziLj-0003RF-OB
	for submit <at> debbugs.gnu.org; Fri, 01 Mar 2019 08:37:16 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36687)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <nicolas.mailhot@HIDDEN>) id 1gzhbY-0002GO-Qw
 for submit <at> debbugs.gnu.org; Fri, 01 Mar 2019 07:49:35 -0500
Received: from lists.gnu.org ([209.51.188.17]:36278)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <nicolas.mailhot@HIDDEN>)
 id 1gzhbR-0002MQ-PZ
 for submit <at> debbugs.gnu.org; Fri, 01 Mar 2019 07:49:25 -0500
Received: from eggs.gnu.org ([209.51.188.92]:51068)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <nicolas.mailhot@HIDDEN>) id 1gzhbQ-00026A-T5
 for bug-coreutils@HIDDEN; Fri, 01 Mar 2019 07:49:25 -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.7 required=5.0 tests=BAYES_40,FREEMAIL_FROM,
 RCVD_IN_DNSWL_LOW,URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <nicolas.mailhot@HIDDEN>) id 1gzhbO-0002Le-LM
 for bug-coreutils@HIDDEN; Fri, 01 Mar 2019 07:49:24 -0500
Received: from smtpoutz25.laposte.net ([194.117.213.100]:39458
 helo=smtp.laposte.net)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <nicolas.mailhot@HIDDEN>)
 id 1gzhbO-0002Eg-6R
 for bug-coreutils@HIDDEN; Fri, 01 Mar 2019 07:49:22 -0500
Received: from smtp.laposte.net (localhost [127.0.0.1])
 by lpn-prd-vrout013 (Postfix) with ESMTP id DC50C107660
 for <bug-coreutils@HIDDEN>; Fri,  1 Mar 2019 13:48:53 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=mail0;
 t=1551444533; bh=Z47d3fwwRH/JqYD6TTu4hA3RzDQ0ZmTujp7Bw7Y2M/Y=;
 h=Subject:From:To:Date;
 b=WNxVt/SSX+7N7MoeR8CSZJH+7cz4JpWdbtXawQp6Yp1Xemdr//88Av48AFVKimWpc
 w1bdSu9CWmOpLLPu3G2UrdAB5HkU9YDCYZP3A3wYZBrQD/aygDx1fd1w5HiM4Qir2C
 R8YBRI7WipUw+zf/1XErzrnateZkdp8nH0PSHXZZ0dKjVJMDJCqR0pFevIzJavkIlG
 oknMkhWrFlVKhY65iss8Sw9JGydqxJwAvJ7xcBQkJMy9ALJanhTIJTu2IXv7ks01Xj
 iVq62YKvK1kO25vCtbTAZGpYZ6aGkigrd3RKGtEo5T3OwwM27onGw3fa7bkk2R+LOF
 x6hIL3GpBbCvw==
Received: from smtp.laposte.net (localhost [127.0.0.1])
 by lpn-prd-vrout013 (Postfix) with ESMTP id B3634107710
 for <bug-coreutils@HIDDEN>; Fri,  1 Mar 2019 13:48:53 +0100 (CET)
Received: from lpn-prd-vrin001 (lpn-prd-vrin001.prosodie [10.128.63.2])
 by lpn-prd-vrout013 (Postfix) with ESMTP id 67B05107660
 for <bug-coreutils@HIDDEN>; Fri,  1 Mar 2019 13:48:53 +0100 (CET)
Received: from lpn-prd-vrin001 (localhost [127.0.0.1])
 by lpn-prd-vrin001 (Postfix) with ESMTP id 25F46373618
 for <bug-coreutils@HIDDEN>; Fri,  1 Mar 2019 13:48:53 +0100 (CET)
Received: from arekh.ddns.net (82-64-49-105.subs.proxad.net [82.64.49.105])
 by lpn-prd-vrin001 (Postfix) with ESMTPA id 110E33735ED
 for <bug-coreutils@HIDDEN>; Fri,  1 Mar 2019 13:48:52 +0100 (CET)
Received: from cerebro.okg (box.okg [192.168.0.1])
 by arekh.ddns.net (Postfix) with ESMTPSA id 9EF972202F9
 for <bug-coreutils@HIDDEN>; Fri,  1 Mar 2019 13:48:51 +0100 (CET)
Message-ID: <7a533bfc2b867bd2a59f8d5564c80b6b2cfc132d.camel@HIDDEN>
Subject: rm refuses to remove files owned by the user, even in force mode
From: Nicolas Mailhot <nicolas.mailhot@HIDDEN>
To: bug-coreutils@HIDDEN
Date: Fri, 01 Mar 2019 13:48:51 +0100
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.31.91 (3.31.91-1.fc30) 
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-VR-FullState: 0
X-VR-Score: 50
X-VR-Cause-1: gggruggvucftvghtrhhoucdtuddrgedutddrvdehgdegfecutefuodetggdotefrodftvfcurfhrohhf
X-VR-Cause-2: ihhlvgemucfntefrqffuvffgnecuuegrihhlohhuthemucehtddtnecuogetfeejfedqtdegucdlhedt
X-VR-Cause-3: mdenucfjughrpefkuffhvffftggfggfgsehtjeertddtreejnecuhfhrohhmpefpihgtohhlrghsucfo
X-VR-Cause-4: rghilhhhohhtuceonhhitgholhgrshdrmhgrihhlhhhotheslhgrphhoshhtvgdrnhgvtheqnecuffho
X-VR-Cause-5: mhgrihhnpehgihhthhhusgdrtghomhenucfkphepkedvrdeigedrgeelrddutdehnecurfgrrhgrmhep
X-VR-Cause-6: mhhouggvpehsmhhtphhouhhtpdhinhgvthepkedvrdeigedrgeelrddutdehpdhhvghloheprghrvghk
X-VR-Cause-7: hhdruggunhhsrdhnvghtpdhmrghilhhfrhhomhepnhhitgholhgrshdrmhgrihhlhhhotheslhgrphho
X-VR-Cause-8: shhtvgdrnhgvthdprhgtphhtthhopegsuhhgqdgtohhrvghuthhilhhssehgnhhurdhorhhgnecuvehl
X-VR-Cause-9: uhhsthgvrhfuihiivgeptd
X-VR-AvState: No
X-VR-State: 0
X-VR-State: 0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 194.117.213.100
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 01 Mar 2019 08:37:14 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

Hi,

For their own reasons, the Go maintainers have decided the user Go cache
will now be read-only.
https://github.com/golang/go/issues/27161#issuecomment-433098406

That means cleaning up cache artefacts with rm does not work anymore
https://github.com/golang/go/issues/30502

I understand the need to protect read only files (even though they're
supposed to have been created by a user decision, not by user-hostile
tools). However should not rm remove the files anyway in force (-f) mode
without an explicit chmod first? Do it without bothering me is why -f
exists after all.

$ rpm -q --whatprovides /usr/bin/rm
coreutils-8.30-9.fc30.x86_64

Best regards,

-- 
Nicolas Mailhot





Acknowledgement sent to Nicolas Mailhot <nicolas.mailhot@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#34700; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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