Skip to content
Snippets Groups Projects
Unverified Commit 37b998d0 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #6690 from maxim-belkin/harden-brew-2.0

bin/brew: unset functions that override builtins
parents c169348f c87d2181
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,15 @@ symlink_target_directory() {
quiet_cd "$directory" && quiet_cd "$target_dirname" && pwd -P
}
# Enable and use default Bash builtins rather than user-defined functions
builtin enable compgen unset
for cmd in $(builtin compgen -A builtin)
do
builtin unset -f $cmd
builtin enable $cmd
done
unset cmd
BREW_FILE_DIRECTORY="$(quiet_cd "${0%/*}/" && pwd -P)"
HOMEBREW_BREW_FILE="${BREW_FILE_DIRECTORY%/}/${0##*/}"
HOMEBREW_PREFIX="${HOMEBREW_BREW_FILE%/*/*}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment