major improvements to temp file name generator
authorRich Felker <dalias@aerifal.cx>
Fri, 18 Feb 2011 22:04:56 +0000 (17:04 -0500)
committerRich Felker <dalias@aerifal.cx>
Fri, 18 Feb 2011 22:04:56 +0000 (17:04 -0500)
commit446b4207cc7a30d8a4d5b2445a5a1b27d440f55d
tree3bc2e2969267d28e3c5b841c25e025afbb1623d4
parent3e9e30166f22f8fb0d5664500bb52a00d1a3c6a3
major improvements to temp file name generator

use current time in nanoseconds and some potentially-random (if aslr
is enabled) pointer values for the initial tempfile name generation,
and step via a cheap linear prng on collisions. limit the number of
retry attempts to prevent denial of service attacks even if an
attacker can guess the filenames.
src/temp/mkdtemp.c
src/temp/mkstemp.c
src/temp/mktemp.c