fix: windows-safe config discovery and OS-independent policy globs - #599
Merged
Merged
Conversation
- skip the `/etc/xdg` default for `XDG_CONFIG_DIRS` on windows. there it resolves to `\etc\xdg` at the drive root, which any local user can create, so a planted `grant.yaml` could override the user's policy. an explicit `XDG_CONFIG_DIRS` is still honored - match `allow` and `ignore-packages` patterns with `path.Match` instead of `filepath.Match`, so results are the same on every OS. on windows this means `*` no longer crosses `/` and a backslash is now an escape, matching linux and mac - document the pattern syntax on `Policy` Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman
force-pushed
the
fix/windows-config-and-policy-globs
branch
from
October 2, 2026 16:55
9bcd54d to
841f8b7
Compare
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.
Two pre-existing issues that start to matter once grant ships windows binaries (#440). Safe to land before or alongside it.
/etc/xdgdefault forXDG_CONFIG_DIRSon windows. there it resolves to\etc\xdgat the drive root, which any local user can create, so a plantedgrant.yamlcould override the user's policy. an explicitXDG_CONFIG_DIRSis still honoredallowandignore-packagespatterns withpath.Matchinstead offilepath.Match, so results are the same on every OS. linux and mac are unchanged. on windows*no longer crosses/(e.g.github.com/*/foono longer matchesgithub.com/a/b/foo) and a backslash is now an escapePolicy