unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: Remote temporary directory
Date: Sun, 31 Jul 2016 10:19:03 -0400	[thread overview]
Message-ID: <jwvd1ltvqvr.fsf-monnier+Inbox@gnu.org> (raw)
In-Reply-To: <87mvky2gmi.fsf@gmx.de> (Michael Albinus's message of "Sun, 31 Jul 2016 13:26:13 +0200")

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

No, indeed, it's hard to check it reliably.  So instead make-temp-file
relies on temporary-file-directory having a sane value.

> It will be even harder to fulfill this in the remote case.

Exactly.  And for make-nearby-temp-file the intention to save "nearby"
(in the same mount point so that `rename' works "atomically".  On AFS
file-systems this basically mean it can only be in the *same* directory)
might be impossible to satisfy while still using a safe directory.

> Shall we add
> an optional argument SAVE-DIR-ONLY to `make-temp-file' /
                       ^^^^
You mean               safe   ?

> `make-nearby-temp-file'?  If non-nil, the checks above are performed.

I don't know how to implement those checks in a robust way.


        Stefan



  reply	other threads:[~2016-07-31 14:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <acdfa136-1d37-a920-b572-fdd0f6e11257@gmail.com>
     [not found] ` <837fch1vmw.fsf@gnu.org>
     [not found]   ` <8536522f-fa3f-9fe0-63c0-262b8191b4a3@gmail.com>
     [not found]     ` <83h9bdttxi.fsf@gnu.org>
     [not found]       ` <87lh0ons06.fsf@gmx.de>
     [not found]         ` <83r3afst6v.fsf@gnu.org>
2016-07-27  9:57           ` Remote temporary directory (was: bug#23076: 24.5; vc-git: add a new variable for log output coding system) Michael Albinus
2016-07-27 11:42             ` Remote temporary directory Nikolay Kudryavtsev
2016-07-27 12:27               ` Michael Albinus
2016-07-27 16:09             ` Remote temporary directory (was: bug#23076: 24.5; vc-git: add a new variable for log output coding system) Eli Zaretskii
2016-07-27 16:56               ` Remote temporary directory Michael Albinus
2016-07-27 17:37                 ` Eli Zaretskii
2016-07-27 18:14                   ` Michael Albinus
2016-07-29 20:15                     ` Michael Albinus
2016-07-29 21:02                       ` Stefan Monnier
2016-07-31 11:26                         ` Michael Albinus
2016-07-31 14:19                           ` Stefan Monnier [this message]
2016-07-31 14:45                             ` Michael Albinus
2016-07-30  6:58                       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd1ltvqvr.fsf-monnier+Inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).