[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Remote temporary directory
From: |
Michael Albinus |
Subject: |
Re: Remote temporary directory |
Date: |
Sun, 31 Jul 2016 13:26:13 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> Maybe a new `make-nearby-temp-file` would work, where Emacs would try to
> create the temp file "as close as possible" to some target directory.
>
> This could also be used for things like "save into a temp file and then
> rename that file to the actual destination".
Will do.
> This said, there are some non-trivial security issues at stake here:
> make-temp-file should usually only be used in directories which are
> either only writable by "trusted" users (i.e. only by the current user),
> or which have the magical "sticky" bit set. So using just any writable
> "nearby" directory is generally unsafe.
I agree. But `make-temp-file' does not check:
(let ((temporary-file-directory "~/")) (make-temp-file "tmp"))
=> "/home/albinus/tmp17866D3i"
It will be even harder to fulfill this in the remote case. Shall we add
an optional argument SAVE-DIR-ONLY to `make-temp-file' /
`make-nearby-temp-file'? If non-nil, the checks above are performed.
Furthermore, there are file name handlers which do not know of a
temporary directory. Think about "/davs:" or "/gdrive:" etc. On those
remote locations, the function `temporary-file-directory' will return
the current remote directory, and `make-nearby-temp-file' will create
the temp file here.
> Stefan
Best regards, Michael.
- Remote temporary directory (was: bug#23076: 24.5; vc-git: add a new variable for log output coding system), Michael Albinus, 2016/07/27
- Re: Remote temporary directory, Nikolay Kudryavtsev, 2016/07/27
- Re: Remote temporary directory (was: bug#23076: 24.5; vc-git: add a new variable for log output coding system), Eli Zaretskii, 2016/07/27
- Re: Remote temporary directory, Michael Albinus, 2016/07/27
- Re: Remote temporary directory, Eli Zaretskii, 2016/07/27
- Re: Remote temporary directory, Michael Albinus, 2016/07/27
- Re: Remote temporary directory, Michael Albinus, 2016/07/29
- Re: Remote temporary directory, Stefan Monnier, 2016/07/29
- Re: Remote temporary directory,
Michael Albinus <=
- Re: Remote temporary directory, Stefan Monnier, 2016/07/31
- Re: Remote temporary directory, Michael Albinus, 2016/07/31
- Re: Remote temporary directory, Eli Zaretskii, 2016/07/30