Add warning for formula installation from forbidden paths#20444
Merged
MikeMcQuaid merged 1 commit intomainfrom Aug 13, 2025
Merged
Add warning for formula installation from forbidden paths#20444MikeMcQuaid merged 1 commit intomainfrom
MikeMcQuaid merged 1 commit intomainfrom
Conversation
Copilot
AI
changed the title
[WIP] Improve error when preventing install formula from local file
Improve error message when installing formula from non-existent local file
Aug 13, 2025
MikeMcQuaid
reviewed
Aug 13, 2025
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
Improve error message when installing formula from non-existent local file
Add warning for formula installation from forbidden paths
Aug 13, 2025
2c49a04 to
27d52b1
Compare
1 task
MikeMcQuaid
approved these changes
Aug 13, 2025
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
27d52b1 to
cfa7326
Compare
3 tasks
3 tasks
p-linnane
approved these changes
Aug 13, 2025
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.
When
HOMEBREW_FORBID_PACKAGES_FROM_PATHSis enabled and users try to install a formula from a local file path outside of allowed directories, they now receive a helpful warning message instead of silent failure.Changes
FromPathLoader.try_newto output a warning usingopoowhenforbid_packages_from_pathsis enabled and the path exists but is outside allowed directoriespath.realpathin a variable to avoid multiple callsbrew createandbrew tap-newwithout referencing developer modeImplementation Details
Testing
Added unit test in
formulary_spec.rbto verify the warning is properly displayed when accessing forbidden paths.Fixes #20441.
Fixes #20448
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.