Skip to content

Make exported files readable according to the process umask on POSIX #14

Open

Description

@scottconverse

Problem

atomic_write_bytes writes through NamedTemporaryFile, which creates the temporary file with mode 0600 on Linux/macOS. The final hard-linked or replaced SRT, VTT, JSON, DOCX, and PDF files retain that restrictive mode. A web server or another permitted user cannot read the export even when the output directory and normal umask would allow it.

Proposed work

Apply a mode derived from the process umask to the completed temporary file before publishing it, without weakening explicitly private storage or breaking atomic no-clobber behavior. Review the desired mode when replacing an existing file.

Acceptance criteria

  • POSIX regression tests cover new exports and replacement, including a non-default umask.
  • Final files are readable under normal umask semantics, not unconditionally world-readable.
  • Windows behavior and atomic/no-clobber output tests remain green.

Identified during the v0.1.5 review; not a blocker for that release.

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

    good first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions