Skip to content

fs::copy is racy on unix #37885

Closed
Closed

Description

  1. It checks if the source file is a regular file by path before opening it. The file could be replaced between checking and opening.
  2. It sets the permissions by path using chmod instead of by file descriptor using fchmod. It could therefore end up setting permissions on the wrong file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions