GNU bug report logs - #27986
26.0.50; `rename-file' can rename files without confirmation

Previous Next

Package: emacs;

Reported by: Philipp <p.stephani2 <at> gmail.com>

Date: Sun, 6 Aug 2017 15:41:02 UTC

Severity: important

Tags: security

Found in version 26.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #130 received at 27986 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: 27986 <at> debbugs.gnu.org
Subject: Re: bug#27986: 26.0.50; 'rename-file' can rename files without
Date: Sat, 19 Aug 2017 17:33:56 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I haven't followed the discussion, but I'm told there is a proposal to
make this change:

  > 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.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





This bug report was last modified 7 years and 257 days ago.

Previous Next


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