all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: David Kastrup <dak@gnu.org>
Cc: emacs-pretest-bug@gnu.org, christopher.ian.moore@gmail.com,
	svenjoac@gmx.de, Stefan Monnier <monnier@iro.umontreal.ca>,
	rms@gnu.org
Subject: Re: creating backups in temporary directories
Date: Sun, 09 Sep 2007 22:27:30 +0200	[thread overview]
Message-ID: <je7imzwpn1.fsf@sykes.suse.de> (raw)
In-Reply-To: <85odgbobf0.fsf@lola.goethe.zz> (David Kastrup's message of "Sun\, 09 Sep 2007 22\:01\:55 +0200")

David Kastrup <dak@gnu.org> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> In a directory with mode 777, that's true: everything is dangerous.
>> But in a directory with mode 1777 when you open a file that *you* own,
>> nobody else can remove it or rename it, so normally nobody can replace it
>> with a symlink.  Emacs creates the problem when it moves /tmp/foo to
>> /tmp/foo~ at which point /tmp/foo is free for an attacker to take.
>
> Well, the alternative is to make a hard link of /tmp/foo to /tmp/foo~,
> then creat /tmp/foo over it and fill it with contents without
> reopening.
>
> That should close the time window for an attack.

You have to unlink the file first, so the window remains.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2007-09-09 20:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-07 10:42 creating backups in temporary directories Chris Moore
2007-09-07 15:36 ` David Kastrup
2007-09-07 17:57   ` Stefan Monnier
2007-09-07 19:43     ` Davis Herring
2007-09-07 19:49     ` Sven Joachim
2007-09-07 19:52       ` David Kastrup
2007-09-08 19:47         ` Richard Stallman
2007-09-07 20:47       ` Stefan Monnier
2007-09-08 19:47         ` Richard Stallman
2007-09-09 19:44           ` Stefan Monnier
2007-09-09 20:01             ` David Kastrup
2007-09-09 20:27               ` Andreas Schwab [this message]
2007-09-10  1:11                 ` David Kastrup
2007-09-10 19:18                   ` Davis Herring
2007-09-10 19:55                     ` David Kastrup
     [not found]                   ` <37852.128.165.123.18.1189451917.squirrel@webmail.lanl.gov>
2007-09-10 19:23                     ` Davis Herring
2007-09-11 20:32                       ` Richard Stallman
2007-09-11 21:17                         ` Davis Herring
2007-09-10  1:12             ` Richard Stallman
2007-09-10  2:59               ` Stefan Monnier
2007-09-08 14:38     ` Chris Moore
2007-09-08 19:48     ` Richard Stallman
2007-09-09 19:41       ` Stefan Monnier
2007-09-09 19:45         ` David Kastrup
2007-09-10  1:12         ` Richard Stallman

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

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

  git send-email \
    --in-reply-to=je7imzwpn1.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=christopher.ian.moore@gmail.com \
    --cc=dak@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    --cc=svenjoac@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.