Skip to content

copyFile opens the file without setting cloexec #203

@joeyh

Description

@joeyh

copyFile opens a temporary file without setting the close-on-exec flag. So if another thread execs a process at the same time, the process can inherit an open FD to a temp file. Specifically, in withReplacementFile, it uses OS.openBinaryTempFile.

copyFileWithMetadata and copyFileToHandle had this same problem fixed in commit 0ff4e13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions