Repository navigation
Read a path entry as the path it spells, where that exists - #622
Merged
Merged
Conversation
A folder may have `*`, `?`, `[` or `]` in its name (`[WIP] project`), and every entry inside one was read as a pattern alone and lost: a Linux write entry was dropped, a read entry expanded to nothing, macOS compiled a regex that misses the folder, Windows expanded a pattern beneath it to nothing. An entry with those characters is now also read as the path it spells where the part that holds them exists on disk, and as its tail pattern beneath an existing directory. The pattern reading stays. A deny takes every reading that may hold; an allow takes one only for a path that is there and is no symbolic link. `path-entries.ts` decides, for the manager and the wrapper's fold on Linux, the profile builder on macOS and `expandWindowsFsPaths` on Windows.
This was referenced Sep 28, 2026
/tmp is a link to /private/tmp there, and a profile's rules go by real paths. Nothing pinned that the anchor of a pattern beneath a bracketed folder is canonicalised like any other path.
This was referenced Sep 29, 2026
Closed
ronleizrowice-ant
added a commit
that referenced
this pull request
Sep 30, 2026
The walk's budget (#607), its shared listings (#627) and its steps (#628) rewrite one code path, and the path entries of #620 to #622 sit on top of it. Everything above the walk is a generator now: the read-deny expansion, the function readDenyGlobExpander() returns, the allowRead expansion, the resolution of read path entries, and withOtherReadings(), which calls the expander once for each reading of an entry. The synchronous names finish those on the spot. In the walk the step comes first and the budget's clock is read after it, before the next listing. The deadline is wall time, so turns given to other work count against it: a wrap can be refused earlier for that, and a list is never cut short. The budget error is given its code around the delegated generator. An abort is raised by the driver and does not pass through there, so a wrap with a spent budget and an aborted signal rejects with the signal's reason. A wrap that starts over makes a new budget and new listings, and reads the new configuration's denyReadGlobBudget. In the scan's catch the abort is looked at first, then what ripgrep listed.
Everything above the walk is a generator on main, so `withOtherReadings`
is one too: git did not mark it. `resolveReadPathEntries` is main's
generator with this branch's `kind`, and both expanders take
`(pattern, anchor)` and pass `{ anchor, listings }`.
One case of this branch asserted that what a pattern would match in a
folder of mode 000 can still be written. Below the working directory that
is no longer so: main's scan for dangerous names denies such a folder
whole. The case now runs from elsewhere as well.
ronleizrowice-ant
dismissed
antdres’s stale review
October 4, 2026 17:39
The base branch was changed.
This was referenced Oct 4, 2026
Merged
ronleizrowice-ant
added a commit
that referenced
this pull request
Oct 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Last of three stacked pull requests replacing #608 (#620, #621, this); base: #621, the marker.
What
A folder may have
*,?,[or]in its name. Every entry inside one was read as a pattern alone, and lost: with/wwritable, adenyWriteon a file in/w/[WIP] projectleft that file writable. An entry is now ALSO read as the path it spells where the part holding those characters exists, and as its tail pattern beneath an existing directory. The pattern reading stays. A deny takes every reading; an allow only a path that is there and no symbolic link.Behaviour changes
lstatfor every pattern entry.denyReadinside a bracketed home.allowOnlypattern string only where it is such a path.initialize().Tests
Real bubblewrap runs on Linux, both runtimes. macOS is profile text compared on Linux: nothing ran under
sandbox-exec. The Windows function ran on Linux; five Windows-only cases were only read. 25 mutations, 24 caught, one equivalent.Merge order
Conflicts with #569, #574, #575 and #607, whose one-argument expander drops
anchor: pass{ budget, anchor }. #581 is an alternative for brackets alone: land one.