Skip to content

manifest fetch-config: --output /dev/stdout and other special paths fail #2224

Description

@TerryHowe

Follow-up from #2222.

oras manifest fetch-config --output <path> now writes to os.CreateTemp(filepath.Dir(path), ...) and then renames the temp file onto <path>. When <path> is a device, a FIFO, or /dev/fd/N, this breaks: for --output /dev/stdout the temp file is created in /dev, which fails for non-root users. Before #2222, os.WriteFile wrote straight to the path, so these targets worked.

Repro

oras manifest fetch-config --output /dev/stdout localhost:5000/hello:v1

Suggested fix: os.Stat the target first. If it exists and !Mode().IsRegular(), stream directly into it and skip temp+rename.

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