rejeep / f.el

Modern API for working with files and directories in Emacs
GNU General Public License v3.0
680 stars 68 forks source link

Adapt to changes in Emacs 26 #86

Closed phst closed 6 years ago

phst commented 6 years ago

In Emacs 26, copy-directory and rename-file no longer test whether their destination argument is a directory because that introduces a filesystem race with possible security implications. Rather, they check whether the argument is a directory name or not.

Fixes #83

sambrightman commented 6 years ago

I'm seeing related breakage, would be great to get this fixed. Is this PR complete? Two questions come to mind:

  1. Is the intention that all client code update for the new semantics, as opposed to f.el abstracting the details of the new files.el? For example, there is still non-backward compatible behaviour when using f-copy on a directory target. f-expand always converting away from directory names is another sticking point. I would guess that f.el can't fix this without worrying about the same security concerns?
  2. If the security concerns are the same here, is there any concern about f-directory? and its aliases?
phst commented 6 years ago

Is the intention that all client code update for the new semantics, as opposed to f.el abstracting the details of the new files.el? For example, there is still non-backward compatible behaviour when using f-copy on a directory target.

The backwards incompatibility is necessary to avoid the security issue, unfortunately.

f-expand always converting away from directory names is another sticking point.

If it does that, we should change it. The distinction between directory names and directory file names is now more important than ever in Emacs.

I would guess that f.el can't fix this without worrying about the same security concerns?

Yes

If the security concerns are the same here, is there any concern about f-directory? and its aliases?

Callers should not use such functions if they enable TOCTTOU issues. It's OK to use them to e.g. display directories differently in some interactive screen.