Skip to content

fs::copy is racy on unix #37885

Description

@Stebalien
  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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions