GNU bug report logs - #28483
26.0.50; copy-directory does not create directories

Previous Next

Package: emacs;

Reported by: Aaron Jensen <aaronjensen <at> gmail.com>

Date: Sun, 17 Sep 2017 19:12:02 UTC

Severity: normal

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 #14 received at 28483 <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Aaron Jensen <aaronjensen <at> gmail.com>, 28483 <at> debbugs.gnu.org
Subject: Re: bug#28483: [PATCH] Fix copy-directory creating missing directory
Date: Sun, 17 Sep 2017 19:48:44 +0000
[Message part 1 (text/plain, inline)]
Aaron Jensen <aaronjensen <at> gmail.com> schrieb am So., 17. Sep. 2017 um
21:16 Uhr:

> * lisp/files.el (copy-directory): Use file-directory-p instead of
> directory-name-p.
> ---
>  lisp/files.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/files.el b/lisp/files.el
> index c55c8097c1..b3a55af976 100644
> --- a/lisp/files.el
> +++ b/lisp/files.el
> @@ -5540,7 +5540,7 @@ copy-directory
>        (setq directory (directory-file-name (expand-file-name directory))
>             newname (expand-file-name newname))
>
> -      (cond ((not (directory-name-p newname))
> +      (cond ((not (file-directory-p newname))
>              ;; If NEWNAME is not a directory name, create it;
>              ;; that is where we will copy the files of DIRECTORY.
>              (make-directory newname parents))
>

This would reintroduce the security hole that
e22794867d878d53675fcc91d2ef1ad2494a2ff2 fixed.

Paul, maybe you want to add some comments to the places where you
introduced `directory-name-p' so that people don't attempt to revert these
changes?
[Message part 2 (text/html, inline)]

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

Previous Next


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