Skip to content

manifest fetch-config: --output <file> forces mode 0644, ignoring umask and existing mode #2226

Description

@TerryHowe

Follow-up from #2222.

--output <file> now writes to a temp file, calls file.Chmod(0644), and renames it into place. Compared with the previous os.WriteFile(path, data, 0666), this changes behavior in three ways:

  • umask is ignored. A user with umask 077 used to get 0600 and now gets world-readable 0644.
  • The existing file mode is lost. Overwriting an existing 0600 file used to keep its mode. Now it becomes 0644.
  • Symlinks are replaced. If <file> is a symlink, it is now replaced by a regular file instead of being written through.

Suggested fix: if the target exists, copy its mode. Otherwise apply 0666 &^ umask, matching what os.WriteFile did. You could also resolve symlinks with filepath.EvalSymlinks before choosing the temp dir and rename target.

Activity

  1. added
    bug
    on Oct 6, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions