History log of /seL4-camkes-master/projects/musllibc/src/temp/mkstemp.c
Revision Date Author Comments
# 2cc63358 20-Feb-2013 Rich Felker <dalias@aerifal.cx>

add mkostemp, mkstemps, and mkostemps functions and reorganize temp internals

based on patch contributed by Anthony G. Basile (blueness)

some issues remain with the filename generation algorithm and other
small bugs, but this patch has been sitting around long enough that I
feel it's best to get it committed and then work out any remaining
issues.


# 69ecbd0f 19-Feb-2011 Rich Felker <dalias@aerifal.cx>

make mktemp match the historic behavior, and update functions that use it

the historic mktemp is supposed to blank the template string on
failure, rather than returning 0. just zero the first character so
that mkstemp and mkdtemp can still retry with O(1) space requirement.


# 2e6239dd 19-Feb-2011 Rich Felker <dalias@aerifal.cx>

fix major bug created from copying mkdtemp logic


# 446b4207 18-Feb-2011 Rich Felker <dalias@aerifal.cx>

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.


# 3e9e3016 18-Feb-2011 Rich Felker <dalias@aerifal.cx>

reformat mkstemp like mkdtemp

this is cleaner and makes it easy to impose a limit on the number of
retries later if it seems desirable to do so.


# 5377715c 14-Feb-2011 Rich Felker <dalias@aerifal.cx>

ensure standard functions mk[sd]temp don't depend on removed function mktemp


# 80695b1d 14-Feb-2011 Rich Felker <dalias@aerifal.cx>

begin namespace-cleanup of standard C headers


# 0b44a031 11-Feb-2011 Rich Felker <dalias@aerifal.cx>

initial check-in, version 0.5.0