The problem happens if you write to a directory to which others have write access. They could swap your file for one of their own, even if they don't have access to your file. This can be a real problem for setuid scripts.
Solutions would be system-specific. On a linux system, for example, you could dup the temp file onto fd 3, make sure it's not close-on-exec, and pass /proc/self/fd/3 for the file name.
In reply to Re: File::Temp::tempfile : name versus handle
by ikegami
in thread File::Temp::tempfile : name versus handle
by mldvx4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |