From 7f22881dd18cc63ef92bfd4653afce773c05b875 Mon Sep 17 00:00:00 2001 From: Matt Hamilton Date: Fri, 2 Oct 2015 15:53:56 -0400 Subject: [PATCH] Remove nonsensical 'security' check For some reason, zshcompsys thinks that it is up to it do be a sysadmin. By default, `compinit` checks for 'insecure' directories and files. From `man 1 zshcompsys`: For security reasons compinit also checks if the completion system would use files not owned by root or by the current user, or files in directories that are world- or group-writable or that are not owned by root or by The current user. People suffering from the rammifications of this can be found here: http://www.wezm.net/technical/2008/09/zsh-cygwin-and-insecure-directories/ http://stackoverflow.com/questions/13762280/zsh-compinit-insecure-directories http://www.zsh.org/mla/users/2008/msg00566.html https://github.com/Homebrew/homebrew/issues/7801 To sumarize, if you have files with permissions that are 'bad' (ex: 777 on /usr/share/folder/), then zshcompsys enables you to ignore those directories and files. That begs the question, why is it zshcompsys' job to police the system? If you have 777 permissions on a folder in /usr/share/something, that makes the sysadmin DUMB. On the flip side, there are many situations in which it is perfectly legitimate to allow a group to have write permissions to a directory that contains binary files. It shouldn't be up to zshcompsys to point out that you're an idiot. Running compaudit (the 'security' checks) also takes up a significant chunk of time, which can be exacerbated on low-end systems. This commit disables the compaudit, while still enabling the .zcompdump as provided by compinit, as it acts as a cache. --- modules/completion/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index 023a90e7..932e7ac8 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -14,8 +14,8 @@ fi # Add zsh-completions to $fpath. fpath=("${0:h}/external/src" $fpath) -# Load and initialize the completion system ignoring insecure directories. -autoload -Uz compinit && compinit -i +# Load and initialize the completion system ignoring checks of insecure directories but still dumping to cache. +autoload -Uz compinit && compinit -C -d ~/.zcompdump # # Options