Files
Parham AlvaniandClaude Opus 5 0b8f4ad1a1 fix(tempfile): avoid hdiutil deprecation warning on macOS 27 (#3610)
macOS 27 deprecated the hdiutil disk image interface that hdid(8) wraps.
Attaching the ramdisk for a secure tempdir still works, but hdid now
prints

  hdiutil: WARNING: 'hdiutil attach -nomount ...' is deprecated.
  Please use 'diskutil image attach --noMount ...' instead.

to stderr on every call. tempfile passes that stderr straight through, so
the warning surfaces in every gopass command that needs a secure tempdir,
notably `gopass edit` and `gopass env`.

Prefer `diskutil image attach --noMount --nobrowse` and fall back to hdid
on releases without the `image` verb. The fallback's stderr is captured
rather than passed through, so probing costs no output on older systems,
and the outcome is memoized to avoid repeating the failed exec.

The two commands format their output differently: hdid pads the device
node with spaces and tabs, diskutil emits it bare. Parse with
strings.Fields instead of cutting at the first space, which would have
kept the trailing newline on diskutil's output.

Also correct the ramdisk size comment: 32768 * 512 byte sectors is 16 MiB,
not 32 MB.



Claude-Session: https://claude.ai/code/session_011xDya1SH2B8fmV7Mx8nDkd

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 16:48:35 +02:00
..
2026-09-09 22:31:39 +02:00