[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rename-file etc. with directory destination

From: Paul Eggert
Subject: rename-file etc. with directory destination
Date: Sun, 13 Aug 2017 15:51:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

To fix a security problem reported in Bug#27986 I am proposing an incompatible change to the Lisp functions rename-file etc. when the NEWFILE argument is a directory but not a directory name (in the Emacs sense). For details, please see:


and please follow up there. Here's a copy of the proposed NEWS entry:

** When the NEWNAME argument of 'copy-file', 'rename-file',
'add-name-to-file', or 'make-symbolic-link' is an existing directory
and the intent is to act on an entry in that directory, NEWNAME should
now be a directory name, e.g., (rename-file "e" "f/") renames to 'f/e'.
Although this formerly happened sometimes even when NEWNAME was not a
directory name, as in (rename-file "e" "f") where 'f' happened to be a
directory, the old behavior had inherent races that led to security
holes, and disagreed with longstanding documentation.  A call like
(rename-file A B) that used the old, undocumented behavior can be
written as (rename-file A (file-name-as-directory B)), a formulation
portable to both older and newer versions of Emacs.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]