[darcs-users] Tmpdirs aren't unique.

David Roundy droundy at abridgegame.org
Tue Apr 6 11:25:47 UTC 2004


On Mon, Apr 05, 2004 at 08:26:13AM -0700, David Brown wrote:
> I haven't tried generating it, but looking at the source, it looks like
> there might be a problem with non-uniqueness of dirs in /tmp/.  What
> happens if multiple users on a system run a darcs command that tries to
> create the same directory in /tmp/?
> 
> An easy solution would be to prefix the directory name with something
> unique (such as a pid).  This would still be possible for a malicious
> person to mess with.
> 
> Another solution would be to use 'mkdtemp', at least when it is
> available.

The solution darcs uses is to create a different directory name if the
first directory name already exists.  So if you kill darcs a few times you
could end up with /tmp/checking, /tmp/checking_0, etc.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list