[PATCH] Avoid near-infinite looping in __gen_tempname

Nickolai Zeldovich nickolai at cs.stanford.edu
Sun Apr 22 20:14:05 PDT 2007


The code to create a unique file (mktemp) has a logic error in uClibc.
 When __gen_tempname picks a file name that already exists, the code
attempts to retry.  However, the code to pick a new file name is
outside of this retry loop, causing a retry with the same exact
filename, which is very likely to fail again.  This patch fixes this
problem by moving the random filename generation code inside the retry
loop:

    http://moscow.scs.stanford.edu/~nickolai/uclibc-tempname-patch

(Again apologies for the URL.)

Nickolai.


More information about the uClibc mailing list