Skip to content

Conversation

@sespiros
Copy link
Contributor

/dev/stdin is passed to genpolicy when called from contrast cli as a way to both a) silence genpolicy from outputting to stdout and b) retrieve genpolicy's output back through stdin. This causes a crash on Darwin like so:

time=2026-01-21T11:56:10.495+02:00 level=DEBUG msg="called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }"

This is due to architectural differences between Linux and Darwin when attempting to write to /dev/stdin when passed via a pipe. Minimal reproducer to run on Darwin and Linux:

echo "test" | python3 -c 'open("/dev/stdin", "w")'

/dev/stdin is passed to genpolicy when called from contrast cli
as a way to both a) silence genpolicy from outputting to stdout and
b) retrieve genpolicy's output back through stdin. This causes
a crash on Darwin like so:

time=2026-01-21T11:56:10.495+02:00 level=DEBUG msg="called `Result::unwrap()`
on an `Err` value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }"

This is due to architectural differences between Linux and Darwin
when attempting to write to /dev/stdin when passed via a pipe.
Minimal reproducer to run on Darwin and Linux:

echo "test" | python3 -c 'open("/dev/stdin", "w")'

Signed-off-by: Spyros Seimenis <sse@edgeless.systems>
@sespiros sespiros requested a review from burgerdev January 26, 2026 13:51
@sespiros sespiros added the no changelog PRs not listed in the release notes label Jan 26, 2026
Copy link
Member

@burgerdev burgerdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you have a chance to consider my comment on the original PR?

disable yaml output when --base64-out or --raw-out are present, because outputting both (or all 3) does not make any sense.

I'd say this has a good chance of being accepted upstream.

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

Labels

no changelog PRs not listed in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants