From 467075d1258f6b4f67258cb803a92e3f425de858 Mon Sep 17 00:00:00 2001 From: Arnaud Venturi Date: Fri, 21 Apr 2017 12:52:18 +1000 Subject: [PATCH 1/4] Deactivated security check at compinit --- base/core/load.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/core/load.zsh b/base/core/load.zsh index 497690c1..2d68291d 100644 --- a/base/core/load.zsh +++ b/base/core/load.zsh @@ -31,7 +31,7 @@ __zplug::core::load::from_cache() # Plugins with defer-level set source "$_zplug_cache[defer_1_plugin]" - compinit -d "$ZPLUG_HOME/zcompdump" + compinit -C -d "$ZPLUG_HOME/zcompdump" if (( $_zplug_boolean_true[(I)$is_verbose] )); then __zplug::io::print::f \ --zplug "$fg[yellow]Run compinit$reset_color\n" From 75fbff9b01b476a8c78649521ba0ab4e78f49d8a Mon Sep 17 00:00:00 2001 From: Arnaud Venturi Date: Thu, 27 Apr 2017 16:26:00 +1000 Subject: [PATCH 2/4] Allowed insecure compinit when using sudo --- base/core/load.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base/core/load.zsh b/base/core/load.zsh index 2d68291d..2d686b0b 100644 --- a/base/core/load.zsh +++ b/base/core/load.zsh @@ -31,7 +31,12 @@ __zplug::core::load::from_cache() # Plugins with defer-level set source "$_zplug_cache[defer_1_plugin]" - compinit -C -d "$ZPLUG_HOME/zcompdump" + if [ ${UID} ] && [ -n ${SUDO_USER} ] ; then + # Disable file permissions check since we did it when starting the shell executing sudo + compinit -u -d "$ZPLUG_HOME/zcompdump" + else + compinit -d "$ZPLUG_HOME/zcompdump" + fi if (( $_zplug_boolean_true[(I)$is_verbose] )); then __zplug::io::print::f \ --zplug "$fg[yellow]Run compinit$reset_color\n" From 05130e1d6672b7504059e651a83d9f611e1a07b9 Mon Sep 17 00:00:00 2001 From: Arnaud Venturi Date: Sat, 3 Jun 2017 22:34:17 +1000 Subject: [PATCH 3/4] Included the style change requested in PR --- base/core/load.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/core/load.zsh b/base/core/load.zsh index 2d686b0b..6b9453f8 100644 --- a/base/core/load.zsh +++ b/base/core/load.zsh @@ -31,7 +31,7 @@ __zplug::core::load::from_cache() # Plugins with defer-level set source "$_zplug_cache[defer_1_plugin]" - if [ ${UID} ] && [ -n ${SUDO_USER} ] ; then + if [[ -n $UID ]] && [[ -n $SUDO_USER ]] ; then # Disable file permissions check since we did it when starting the shell executing sudo compinit -u -d "$ZPLUG_HOME/zcompdump" else From 8d08dc16b4d2997c823e42e32b4ccdf12cb98aea Mon Sep 17 00:00:00 2001 From: Arnaud Venturi Date: Mon, 24 Jul 2017 18:06:27 +1000 Subject: [PATCH 4/4] Update load.zsh --- base/core/load.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/core/load.zsh b/base/core/load.zsh index 6b9453f8..049716c7 100644 --- a/base/core/load.zsh +++ b/base/core/load.zsh @@ -31,7 +31,7 @@ __zplug::core::load::from_cache() # Plugins with defer-level set source "$_zplug_cache[defer_1_plugin]" - if [[ -n $UID ]] && [[ -n $SUDO_USER ]] ; then + if [[ ${UID} -eq 0 ]] && [[ -n ${SUDO_USER} ]]; then # Disable file permissions check since we did it when starting the shell executing sudo compinit -u -d "$ZPLUG_HOME/zcompdump" else