unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: temp file hole?
Date: Thu, 04 Oct 2007 15:56:54 +0200	[thread overview]
Message-ID: <nqejgb56ft.fsf@alcatel-lucent.de> (raw)
In-Reply-To: <jwvtzp7vkp2.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 03 Oct 2007 19:38:27 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

> I'm afraid that the recent change to tramp-make-temp-file to use
> makw-temp-name instead of make-temp-file introduced a security hole (the
> very hole plugged by the introduction of make-temp-file in the first place).

I confess that my Changelog entry is a little bit sloppy. And you are
right, there could be a security hole.

The other reason why I have switched from make-temp-file to
make-temp-name is that make-temp-file creates a file without the
possibility to declare a file name extension. In Tramp, it is
sometimes useful to have the same file name extension in both the
temporary file and the original file the temporary file is used
for. By this, some actions like deciding major mode etc works
automatically.

A solution could be that tramp-make-temp-file takes over part of the
implementation of make-temp-file, i.e. applies make-temp-name, adds
the desired extension to this file name, and creates immediately the
temporary file via a loop like in make-temp-file.

A similar approach should be applied to tramp-make-tramp-temp-file,
which suffers from this security hole since ever.

I'll commit a patch tonight (or tomorrow, depends on my spare time).

> -- Stefan

Thanks, and best regards, Michael.

  reply	other threads:[~2007-10-04 13:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-03 23:38 temp file hole? Stefan Monnier
2007-10-04 13:56 ` Michael Albinus [this message]
2007-10-04 14:37   ` Johan Bockgård
2007-10-04 14:49   ` Michael Albinus
2007-10-05  7:14   ` Ulrich Mueller
2007-10-05  8:29     ` Michael Albinus
2007-10-06 12:06     ` Michael Albinus
2007-10-12  8:12       ` Ulrich Mueller
2007-10-12  8:32         ` Michael Albinus
2007-10-05 13:15   ` Stefan Monnier
2007-10-06 10:12     ` Michael Albinus

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=nqejgb56ft.fsf@alcatel-lucent.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).