Hi Daniel,

On Thu, 17 Sep 2026 00:13:19 -0400 Daniel Colascione via Chicken-users 
<[email protected]> wrote:

> create-temporary-file generates a candidate filename, checks whether it
> exists, and if it doesn't, opens the file in non-exclusive, write, and
> truncate mode. This strategy creates a TOCTOU race and can result in the
> calling process being tricked into truncating files or following
> symlinks it shouldn't. The generated name has too little entropy to make
> guessing infeasible. create-temporary-file should omit the existence
> check and open the generated file using O_EXCL, retrying on EEXIST.
>
> Better yet would be to call mkstemp(3), which addresses these issues
> and others.
>
> create-temporary-directory has a similar race, but because mkdir is
> always exclusive, race failures cause spurious errors instead of
> potentially unwanted file IO. It should retry on collision.

Thanks for bringing this up.  We have
https://bugs.call-cc.org/ticket/tf5/f598bc17026468d3b75cbe36589b2f0321f72fa1/
for this issue

All the best.
Mario
-- 
https://parenteses.org/mario

Reply via email to