Skip to content

macOS: a read rule on a link to a device stays on the link - #694

Merged
ronleizrowice-ant merged 1 commit into
mainfrom
fix/macos-a-read-rule-on-a-link-to-a-device
Oct 12, 2026
Merged

ronleizrowice-ant merged 1 commit into
mainfrom
fix/macos-a-read-rule-on-a-link-to-a-device

Conversation

@ronleizrowice-ant

Copy link
Copy Markdown
Collaborator

Since #680 a read rule on macOS also applies where its path leads. Where that is a device, the rule lands on the device for every command: denyRead on .env -> /dev/null, a common way to blank a file, denies reading /dev/null. A rule on a link to /dev denies all of /dev. Not in a release yet.

What changes (+9/-1)

The second spelling is not added where it lies at or under /dev, as it already is not for /. The rule on the link itself stays. The same for credentials.files entries, deny or mask, and for patterns.

Who sees a difference

macOS only, and only with a read rule on a link into /dev: as in 0.0.79. A device named by its own path is denied as before.

Testing

  • Five tests on the profile's text fail without the change.
  • First run in this pull request's CI: five rows in the real sandbox, macOS only. With each kind of rule in force, cat /dev/null and cat < /dev/null work.
  • The profile's text for nine configurations on 0.0.79, main and here: the six on devices read as on 0.0.79. A link to an ordinary file keeps both spellings.

Not covered

Linux: a denyRead on a link to /dev/null plans a mount on /dev/null, which bubblewrap 0.4.1 refuses. As on main.

#693 holds the same lines.

A read rule also applies where its path leads. Where that is a device, the
rule would be one on the device for every command: a denyRead on a name
blanked with a link to /dev/null denied reading /dev/null. The second spelling
is not added at or under /dev, as it already is not for the root.

@imichaelmoore imichaelmoore left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/stamp

@ronleizrowice-ant
ronleizrowice-ant merged commit 6bd72c1 into main Oct 12, 2026
16 checks passed
@ronleizrowice-ant
ronleizrowice-ant deleted the fix/macos-a-read-rule-on-a-link-to-a-device branch October 12, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants