From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34338: 26.1; delete-file return codes and failures Date: Thu, 07 Feb 2019 05:36:00 +0200 Message-ID: <83ef8ks21r.fsf@gnu.org> References: <20190205214737.vswyk7sfmgkliv7v@E15-2016.optimum.net> <83r2cksxdt.fsf@gnu.org> <20190206210211.f6ugtim5ie22nkd4@E15-2016.optimum.net> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="26303"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34338@debbugs.gnu.org To: Boruch Baum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 07 04:37:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1graUw-0006hy-Cy for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Feb 2019 04:37:10 +0100 Original-Received: from localhost ([127.0.0.1]:33803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1graUv-00048O-6g for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Feb 2019 22:37:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1graUp-000487-2u for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2019 22:37:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1graUo-0002T9-74 for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2019 22:37:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37158) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1graUn-0002T4-TH for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2019 22:37:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1graUn-0005Gi-N3 for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2019 22:37:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Feb 2019 03:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34338 X-GNU-PR-Package: emacs Original-Received: via spool by 34338-submit@debbugs.gnu.org id=B34338.154951057520195 (code B ref 34338); Thu, 07 Feb 2019 03:37:01 +0000 Original-Received: (at 34338) by debbugs.gnu.org; 7 Feb 2019 03:36:15 +0000 Original-Received: from localhost ([127.0.0.1]:36439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1graU2-0005Ff-Nm for submit@debbugs.gnu.org; Wed, 06 Feb 2019 22:36:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1graU0-0005FR-Dd for 34338@debbugs.gnu.org; Wed, 06 Feb 2019 22:36:12 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1graTv-00025I-6D; Wed, 06 Feb 2019 22:36:07 -0500 Original-Received: from [176.228.60.248] (port=1910 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1graTu-0003PX-Q1; Wed, 06 Feb 2019 22:36:07 -0500 In-reply-to: <20190206210211.f6ugtim5ie22nkd4@E15-2016.optimum.net> (message from Boruch Baum on Wed, 6 Feb 2019 16:02:11 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155209 Archived-At: > Date: Wed, 6 Feb 2019 16:02:11 -0500 > From: Boruch Baum > Cc: 34338@debbugs.gnu.org > > > > B2) raise an error when (not NOERROR) and: > > > > > > B2.1) file doesn't exist > > > > > > B2.2) (and (chmod -w) (not FORCE)) > > > > > > B2.3) another form of permission denial is encountered > > > > !ERROR and either of the following, or all of them? > > Either. > > > In any case, you propose a backward-incompatible change in behavior, > > so it won't fly. We could perhaps do it the other way around: add a > > new optional argument ERROR-OUT, which, when non-nil, will cause the > > function to signal an error when B2.1 or B2.2 happen (I believe B2.3 > > already causes an error). And similarly with FORCE. > > > IOW > > ... (snip) ... > > The part that would transform a prior condition of 'crash' to some > return value is a kind of backward-incompatibility that I think most > people would appreciate. I'm more worried about the opposite: signaling an error where we currently silently do nothing. > For a proposed FORCE arg, backward-incompatibility is a positive > feature, a bug-fix Sorry, it's too late to fix such "bugs" in veteran interfaces. We must do that in backward-compatible way. > > > C) maybe log the exact error or reason for nil to *Messages*. > > > > Not sure what you mean by "exact error or reason", I believe we > > already log the reason. > > For me, in response chmod -x $parent_dir, the error message is: > > eval: Removing old name: Permission denied, /home/boruch/foo/bar > > And the response to chattr +i bar > > eval: Removing old name: Operation not permitted, /home/boruch/foo/bar > > So the messages are unique, but not clear. The description comes from the error code returned by a C library function. Doing more than that would mean additional checks, which will be expensive and probably non-portable. I don't see the benefit. I mean, why isn't "Operation not permitted" enough, it tells you that your user is not permitted to do that, which is clear enough IMO.