[CMake] Finding the "Temp" directory code

Eric Noulard eric.noulard at gmail.com
Sat Nov 14 05:44:22 EST 2009


2009/11/14 Michael Wild <themiwi at gmail.com>:
>
> Just using /tmp isn't such a good idea (because of predictability and
> symlink attacks). Which is why on APPLE TMPDIR looks like for, but this
> changes with each session.
>
> /var/folders/Z9/Z9lmRtS+E1CUYo8TIW8r8E+++TM/-Tmp-

I didn't know that property of "session-uniqueness" but that's pretty good.
There is no such mechanism I am aware of on Linux

> Probably you CAN use /tmp if on UNIX and TMPDIR is not set, but then you
> should create a sub-directory with STRING(RANDOM ...)

Yes I agree my primary reason for doing that (create a subdir)
 wasn't security but uniqueness, now I think one should require both
by crafting a tmpdir from  STRING(RANDOM ...)
AND
some USER specific data as a prefix or suffix like ENV(USER) or ENV(USERNAME).
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list