all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: herring@lanl.gov
Cc: schwab@suse.de, monnier@iro.umontreal.ca,
	emacs-pretest-bug@gnu.org, christopher.ian.moore@gmail.com,
	svenjoac@gmx.de
Subject: Re: creating backups in temporary directories
Date: Tue, 11 Sep 2007 16:32:04 -0400	[thread overview]
Message-ID: <E1IVCOy-0000te-Pv@fencepost.gnu.org> (raw)
In-Reply-To: <37871.128.165.123.18.1189452201.squirrel@webmail.lanl.gov> (herring@lanl.gov)

    This of course applies to the backup-by-copying case too: then just open
    /tmp/foo~ with O_EXCL when performing the copy, with /tmp/randomfile~ and
    "you have enemies" if it fails.

The code in backup-buffer-copy already does part of this;
it calls copy-file  in a way that uses O_EXCL.

    If /tmp/foo~ already exists, rename it first to /tmp/backupforthebackup~
    rather than unlinking it; we have to get it out of the way and use O_EXCL
    even if we own it in case the directory's owner is the attacker.

Why is this needed?  When we're doing the copy, the actual source file
also exists.

  reply	other threads:[~2007-09-11 20:32 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
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 [this message]
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=E1IVCOy-0000te-Pv@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=christopher.ian.moore@gmail.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=herring@lanl.gov \
    --cc=monnier@iro.umontreal.ca \
    --cc=schwab@suse.de \
    --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.