From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#27986: 26.0.50; 'rename-file' can rename files without confirmation Date: Mon, 14 Aug 2017 18:19:24 -0700 Organization: UCLA Computer Science Department Message-ID: <4dfc78db-b550-4cc6-efad-67b7c57c3cce@cs.ucla.edu> References: <61980dde-3d68-7200-e7f4-98f62e410060@cs.ucla.edu> <0e80a1cf-8217-9e9a-a00f-9fdbd6575fc4@cs.ucla.edu> <0a79089f-36ed-8183-a3bf-6cfa32cb9028@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------15214F29F7C6BD4104BC5CED" X-Trace: blaine.gmane.org 1502760022 9051 195.159.176.226 (15 Aug 2017 01:20:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 Aug 2017 01:20:22 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Cc: 27986@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 15 03:20:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhQWd-0001Up-6T for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Aug 2017 03:20:07 +0200 Original-Received: from localhost ([::1]:47147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhQWj-0001Rm-MQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Aug 2017 21:20:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhQWd-0001P2-Id for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2017 21:20:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhQWY-0002sK-Kc for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2017 21:20:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57100) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dhQWY-0002sC-HT for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2017 21:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dhQWY-0006HS-BT for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2017 21:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Aug 2017 01:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27986 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: security Original-Received: via spool by 27986-submit@debbugs.gnu.org id=B27986.150275997724131 (code B ref 27986); Tue, 15 Aug 2017 01:20:02 +0000 Original-Received: (at 27986) by debbugs.gnu.org; 15 Aug 2017 01:19:37 +0000 Original-Received: from localhost ([127.0.0.1]:37547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhQW9-0006H9-7U for submit@debbugs.gnu.org; Mon, 14 Aug 2017 21:19:37 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:40732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhQW6-0006H3-Uk for 27986@debbugs.gnu.org; Mon, 14 Aug 2017 21:19:35 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 46C241600B5; Mon, 14 Aug 2017 18:19:28 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id bMlSMXtuvhBi; Mon, 14 Aug 2017 18:19:27 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1E53B1600CF; Mon, 14 Aug 2017 18:19:27 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vsq5Ksew56XD; Mon, 14 Aug 2017 18:19:27 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id E1DDD1600B5; Mon, 14 Aug 2017 18:19:26 -0700 (PDT) In-Reply-To: <0a79089f-36ed-8183-a3bf-6cfa32cb9028@cs.ucla.edu> Content-Language: en-US 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: 208.118.235.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:135764 Archived-At: This is a multi-part message in MIME format. --------------15214F29F7C6BD4104BC5CED Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Paul Eggert wrote: > I installed the patch on 'master' to help you do that. After rereading the Apple manual I installed the attached further patch into master, so please try updating to the latest master before testing. --------------15214F29F7C6BD4104BC5CED Content-Type: text/x-patch; name="0001-Improve-rename-file-port-to-macOS.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Improve-rename-file-port-to-macOS.patch" >From 97460582e2d0052f27d342ddb90309dc3da700b8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Aug 2017 18:16:04 -0700 Subject: [PATCH] Improve rename-file port to macOS * src/fileio.c (Frename_file): On macOS, renameat_noreplace can fail with errno == ENOTSUP on file systems where it is not supported, according to the Apple documentation. --- src/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index 9f6de5b..e557483 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2297,7 +2297,7 @@ This is what happens in interactive use with M-x. */) rename_errno = errno; switch (rename_errno) { - case EEXIST: case EINVAL: case ENOSYS: + case EEXIST: case EINVAL: case ENOSYS: case ENOTSUP: barf_or_query_if_file_exists (newname, rename_errno == EEXIST, "rename to it", INTEGERP (ok_if_already_exists), -- 2.7.4 --------------15214F29F7C6BD4104BC5CED--