From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27986: 26.0.50; 'rename-file' can rename files without Date: Sun, 20 Aug 2017 05:37:33 +0300 Message-ID: <83wp5zc6c2.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1503196693 869 195.159.176.226 (20 Aug 2017 02:38:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 20 Aug 2017 02:38:13 +0000 (UTC) Cc: 27986@debbugs.gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 20 04:38:08 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 1djG7r-0008Gf-4e for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Aug 2017 04:38:07 +0200 Original-Received: from localhost ([::1]:37755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djG7w-0008Id-8d for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Aug 2017 22:38:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djG7p-0008Hn-Cr for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2017 22:38:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djG7m-0000ND-7E for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2017 22:38:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37306) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djG7m-0000N4-3A for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2017 22:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1djG7l-0002pi-Ql for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2017 22:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Aug 2017 02:38:01 +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.150319667810881 (code B ref 27986); Sun, 20 Aug 2017 02:38:01 +0000 Original-Received: (at 27986) by debbugs.gnu.org; 20 Aug 2017 02:37:58 +0000 Original-Received: from localhost ([127.0.0.1]:45987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djG7h-0002pR-S5 for submit@debbugs.gnu.org; Sat, 19 Aug 2017 22:37:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djG7g-0002pE-Gv for 27986@debbugs.gnu.org; Sat, 19 Aug 2017 22:37:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djG7X-0000J3-Tj for 27986@debbugs.gnu.org; Sat, 19 Aug 2017 22:37:51 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djG7X-0000Iv-Pf for 27986@debbugs.gnu.org; Sat, 19 Aug 2017 22:37:47 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3833 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1djG7Q-0004XS-K6; Sat, 19 Aug 2017 22:37:41 -0400 In-reply-to: (message from Richard Stallman on Sat, 19 Aug 2017 17:33:56 -0400) 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: 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:135928 Archived-At: > From: Richard Stallman > Date: Sat, 19 Aug 2017 17:33:56 -0400 > > > Btw, in case it isn't clear: the issue at hand is an incompatible > > change to rename-file (and probably also other functions, like > > copy-file). Where previously (rename-file A B) with B a directory > > will move A into B/A, under the proposed change it will only do so if > > B actually ended in a slash; otherwise it will move A to B, deleting B > > if it exists. The incompatibility will manifest itself if some old > > code expects to get B/A, but instead gets either an error (if B is a > > non-empty directory) or B silently removed (if it is empty). > > Assuming this applies only when directory B is empty, so that this > won't delete non-empty directories, then I don't have any objection. > I would object to deleting non-empty directories here. > > Another option that might be good is to make this operation always > signal an error in the case where B is a directory and does not end > with a slash. > > I don't have an opinion about which of those two is better. Thanks. I do indeed think that making this an error even if B is an empty directory would be better, as it will reveal the cases that need to be fixed more prominently.