emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating backups in temporary directories


From: David Kastrup
Subject: Re: creating backups in temporary directories
Date: Sun, 09 Sep 2007 22:01:55 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Stefan Monnier <address@hidden> 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.

Anyway, using O_CREAT|O_EXCL when opening refuses to go through
symbolic links.

So we should have a few options available for avoiding problems.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]