From afba4f6b9feb3a9dde4331cd2ed892c4da2df6e3 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 15 May 2018 21:22:47 +0200 Subject: Load insecure completion files if compfix is disabled We have to assume that if people disabled the compfix system they really want their completion to work, ignoring any permission issues. Fixes #5651 Fixes #5957 Fixes #6461 --- oh-my-zsh.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 7f78e4140..c0e2ba8f6 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -11,8 +11,6 @@ fpath=($ZSH/functions $ZSH/completions $fpath) # Load all stock functions (from $fpath files) called below. autoload -U compaudit compinit -: ${ZSH_DISABLE_COMPFIX:=true} - # Set ZSH_CUSTOM to the path where your custom config files # and plugins exists, or else we will use the default custom/ if [[ -z "$ZSH_CUSTOM" ]]; then @@ -74,7 +72,7 @@ if [[ $ZSH_DISABLE_COMPFIX != true ]]; then compinit -d "${ZSH_COMPDUMP}" fi else - compinit -i -d "${ZSH_COMPDUMP}" + compinit -u -d "${ZSH_COMPDUMP}" fi # Load all of the plugins that were defined in ~/.zshrc -- cgit v1.2.3-70-g09d2 From b91659951e15c288c8b9d6b947dfde9c6dceae22 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 26 May 2018 21:26:49 +0200 Subject: Always load secure completion directories --- oh-my-zsh.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c0e2ba8f6..72527362f 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -63,15 +63,14 @@ if [ -z "$ZSH_COMPDUMP" ]; then fi if [[ $ZSH_DISABLE_COMPFIX != true ]]; then - # If completion insecurities exist, warn the user without enabling completions. + # If completion insecurities exist, warn the user if ! compaudit &>/dev/null; then - # This function resides in the "lib/compfix.zsh" script sourced above. handle_completion_insecurities - # Else, enable and cache completions to the desired file. - else - compinit -d "${ZSH_COMPDUMP}" fi + # Load only from secure directories + compinit -i -d "${ZSH_COMPDUMP}" else + # If the user wants it, load from all found directories compinit -u -d "${ZSH_COMPDUMP}" fi -- cgit v1.2.3-70-g09d2 From de8299d6c4f50bc40286a05cd7e802b6bffe41f0 Mon Sep 17 00:00:00 2001 From: Chao Du Date: Mon, 2 Nov 2015 14:29:37 +0800 Subject: Fixed Issue #4550: Move ~/.zsh-update file to $ZSH_CACHE_DIR --- oh-my-zsh.sh | 14 +++++++------- tools/check_for_upgrade.sh | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 72527362f..ca505d1ba 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -1,6 +1,12 @@ +# Set ZSH_CACHE_DIR to the path where cache files should be created +# or else we will use the default cache/ +if [[ -z "$ZSH_CACHE_DIR" ]]; then + ZSH_CACHE_DIR="$ZSH/cache" +fi + # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then - env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh + env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh fi # Initializes Oh My Zsh @@ -17,12 +23,6 @@ if [[ -z "$ZSH_CUSTOM" ]]; then ZSH_CUSTOM="$ZSH/custom" fi -# Set ZSH_CACHE_DIR to the path where cache files should be created -# or else we will use the default cache/ -if [[ -z "$ZSH_CACHE_DIR" ]]; then - ZSH_CACHE_DIR="$ZSH/cache" -fi - # Load all of the config files in ~/oh-my-zsh that end in .zsh # TIP: Add files you don't want in git to .gitignore diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index b42b87750..05b31e8d4 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -7,7 +7,7 @@ function _current_epoch() { } function _update_zsh_update() { - echo "LAST_EPOCH=$(_current_epoch)" >! ~/.zsh-update + echo "LAST_EPOCH=$(_current_epoch)" >! ${ZSH_CACHE_DIR}/.zsh-update } function _upgrade_zsh() { @@ -30,11 +30,11 @@ fi whence git >/dev/null || return 0 if mkdir "$ZSH/log/update.lock" 2>/dev/null; then - if [ -f ~/.zsh-update ]; then - . ~/.zsh-update + if [ -f ${ZSH_CACHE_DIR}/.zsh-update ]; then + . ${ZSH_CACHE_DIR}/.zsh-update if [[ -z "$LAST_EPOCH" ]]; then - _update_zsh_update && return 0; + _update_zsh_update && return 0 fi epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) -- cgit v1.2.3-70-g09d2 From e96a7b728a9c15f5615f4e41a79a5f0fe2b97712 Mon Sep 17 00:00:00 2001 From: Chao Du Date: Tue, 29 Dec 2015 11:17:02 +0800 Subject: migrate .zsh-update file --- oh-my-zsh.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index ca505d1ba..d7c68d35c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -4,6 +4,11 @@ if [[ -z "$ZSH_CACHE_DIR" ]]; then ZSH_CACHE_DIR="$ZSH/cache" fi +# Migrate .zsh-update file to $ZSH_CACHE_DIR +if [ -f ~/.zsh-update ] && [ ! -f ${ZSH_CACHE_DIR}/.zsh-update ]; then + mv ~/.zsh-update ${ZSH_CACHE_DIR}/.zsh-update +fi + # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh -- cgit v1.2.3-70-g09d2