mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-17 11:20:09 +00:00
fix(init): check for unsafe directories in fpath
(#10672)
This commit is contained in:
parent
51555fc4b3
commit
a26d72baa2
1 changed files with 6 additions and 5 deletions
11
oh-my-zsh.sh
11
oh-my-zsh.sh
|
@ -120,17 +120,18 @@ fi
|
||||||
|
|
||||||
if [[ "$ZSH_DISABLE_COMPFIX" != true ]]; then
|
if [[ "$ZSH_DISABLE_COMPFIX" != true ]]; then
|
||||||
source "$ZSH/lib/compfix.zsh"
|
source "$ZSH/lib/compfix.zsh"
|
||||||
# If completion insecurities exist, warn the user
|
|
||||||
handle_completion_insecurities
|
|
||||||
# Load only from secure directories
|
# Load only from secure directories
|
||||||
compinit -i -C -d "$ZSH_COMPDUMP"
|
compinit -i -d "$ZSH_COMPDUMP"
|
||||||
|
# If completion insecurities exist, warn the user
|
||||||
|
handle_completion_insecurities &|
|
||||||
else
|
else
|
||||||
# If the user wants it, load from all found directories
|
# If the user wants it, load from all found directories
|
||||||
compinit -u -C -d "$ZSH_COMPDUMP"
|
compinit -u -d "$ZSH_COMPDUMP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Append zcompdump metadata if missing
|
# Append zcompdump metadata if missing
|
||||||
if (( $zcompdump_refresh )); then
|
if (( $zcompdump_refresh )) \
|
||||||
|
|| ! command grep -q -Fx "$zcompdump_revision" "$ZSH_COMPDUMP" 2>/dev/null; then
|
||||||
# Use `tee` in case the $ZSH_COMPDUMP filename is invalid, to silence the error
|
# Use `tee` in case the $ZSH_COMPDUMP filename is invalid, to silence the error
|
||||||
# See https://github.com/ohmyzsh/ohmyzsh/commit/dd1a7269#commitcomment-39003489
|
# See https://github.com/ohmyzsh/ohmyzsh/commit/dd1a7269#commitcomment-39003489
|
||||||
tee -a "$ZSH_COMPDUMP" &>/dev/null <<EOF
|
tee -a "$ZSH_COMPDUMP" &>/dev/null <<EOF
|
||||||
|
|
Loading…
Reference in a new issue