Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folder permission "Insecure completion-dependent directories detected" #6835

Closed
rafaelstz opened this issue May 17, 2018 · 23 comments

Comments

Projects
None yet
@rafaelstz
Copy link

commented May 17, 2018

GO TO SOLUTION

I'm receiving this message below, I've use the command sudo chmod -R 755 /usr/local/share/zsh but didn't fix all folders, this message continue showing.

[oh-my-zsh] Insecure completion-dependent directories detected:
lrwxr-xr-x  1 rafael  admin  88 Apr 28 15:51 /usr/local/share/zsh/site-functions/_brew_services -> ../../../Homebrew/Library/Taps/homebrew/homebrew-services/completions/zsh/_brew_services
[oh-my-zsh] For safety, completions will be disabled until you manually fix all
[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

How could I fix that?
Thanks

@ghost ghost added the Type: bug label May 17, 2018

@jhullse

This comment has been minimized.

Copy link

commented May 18, 2018

I updated oh-my-zsh today and I am receiving the same message but in a different location after executing sudo su.

[oh-my-zsh] Insecure completion-dependent directories detected:
drwxr-xr-x  11 jhonatan jhonatan 4096 May 17 21:26 /home/jhonatan/.oh-my-zsh
drwxr-xr-x 243 jhonatan jhonatan 4096 May 17 21:26 /home/jhonatan/.oh-my-zsh/plugins
drwxr-xr-x   2 jhonatan jhonatan 4096 May 17 21:26 /home/jhonatan/.oh-my-zsh/plugins/git
[oh-my-zsh] For safety, completions will be disabled until you manually fix all
[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:81: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:95: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:102: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:115: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:125: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:135: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:144: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:150: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:153: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:156: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:159: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:169: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:172: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:174: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:188: command not found: compdef
/home/jhonatan/.oh-my-zsh/plugins/git/git.plugin.zsh:200: command not found: compdef
@simplegadget512

This comment has been minimized.

Copy link

commented May 18, 2018

Same here. I purposely have group rwx permissions on directories in /usr/local so that multiple users (all me, atm) can access and perform updates on homebrew and other software, as necessary, from any login.

@jimages

This comment has been minimized.

Copy link

commented May 18, 2018

Same here.

Last login: Wed May 16 10:13:00 on ttys000
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxr-xr-x  3 zack  admin   96 Jun 19  2017 /usr/local/share/zsh
drwxr-xr-x  6 zack  admin  192 Nov 13  2017 /usr/local/share/zsh/site-functions
lrwxr-xr-x  1 zack  admin   39 Jun 19  2017 /usr/local/share/zsh/site-functions/_brew -> ../../../Homebrew/completions/zsh/_brew
lrwxr-xr-x  1 zack  admin   44 Jun 19  2017 /usr/local/share/zsh/site-functions/_brew_cask -> ../../../Homebrew/completions/zsh/_brew_cask
lrwxr-xr-x  1 zack  admin   88 Jun 29  2017 /usr/local/share/zsh/site-functions/_brew_services -> ../../../Homebrew/Library/Taps/homebrew/homebrew-services/completions/zsh/_brew_services
lrwxr-xr-x  1 zack  admin   59 Nov 13  2017 /usr/local/share/zsh/site-functions/_j -> ../../../Cellar/autojump/22.5.1/share/zsh/site-functions/_j
[oh-my-zsh] For safety, completions will be disabled until you manually fix all
[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:81: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:95: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:102: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:115: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:125: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:135: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:144: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:150: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:153: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:156: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:159: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:169: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:172: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:174: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:188: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/git/git.plugin.zsh:200: command not found: compdef
/Users/jimages/.oh-my-zsh/plugins/osx/osx.plugin.zsh:178: command not found: compdef

Environment:
Retina Macbook Pro 15'
MacOS 10.13.4

Configure:

export ZSH=/Users/jimages/.oh-my-zsh
ZSH_THEME="agnoster"
ENABLE_CORRECTION="true"
HIST_STAMPS="mm/dd/yyyy"
DEFAULT_USER='jimages'
plugins=(
  git
  osx
  autojump
)
source $ZSH/oh-my-zsh.sh
export LANG=en_US.UTF-8
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
export http_proxy=http://127.0.0.1:1087;
export https_proxy=http://127.0.0.1:1087;
export HTTP_PROXY=http://127.0.0.1:1087;
export HTTPS_PROXY=http://127.0.0.1:1087;
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles

It seems like a bug in multi-user environment

@AkdM

This comment has been minimized.

Copy link

commented May 18, 2018

Same here, I've updated zsh yesterday and I have the same errors.

@peanutgao

This comment has been minimized.

Copy link

commented May 18, 2018

I update this afternoon, has same problem. Please tell me How to solve it ?

Last login: Fri May 18 17:38:26 on ttys009
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x 6 Joseph staff 192 7 31 2017 /usr/local/share/zsh
drwxrwxr-x 8 Joseph staff 256 3 5 15:42 /usr/local/share/zsh/site-functions
[oh-my-zsh] For safety, completions will be disabled until you manually fix all
[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:81: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:95: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:102: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:115: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:125: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:135: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:144: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:150: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:153: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:156: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:159: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:169: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:172: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:174: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:188: command not found: compdef
/Users/Joseph/.oh-my-zsh/plugins/git/git.plugin.zsh:200: command not found: compdef

@AkdM

This comment has been minimized.

Copy link

commented May 18, 2018

Disabling the git extension in the .zshrc file obviously hides the command not found: compdef error. But I still have the following:

Last login: Fri May 18 11:47:06 on ttys004
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x  3 myusername  admin  102 Sep  4  2017 /usr/local/share/zsh
drwxrwxr-x  7 myusername  admin  238 Apr  3 11:34 /usr/local/share/zsh/site-functions
[oh-my-zsh] For safety, completions will be disabled until you manually fix all
[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh.
[oh-my-zsh] See the above list for directories with group or other writability.
@sourabh-goyal

This comment has been minimized.

Copy link

commented May 18, 2018

facing same issue after updating oh-my-zsh today
`[oh-my-zsh] Insecure completion-dependent directories detected:
lrwxr-xr-x 1 root wheel 55 Jul 8 2016 /usr/local/share/zsh/site-functions/_git -> ../../../Cellar/git/2.8.3/share/zsh/site-functions/_git
[oh-my-zsh] For safety, completions will be disabled until you manually fix all
[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:81: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:95: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:102: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:115: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:125: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:135: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:144: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:150: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:153: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:156: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:159: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:169: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:172: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:174: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:188: command not found: compdef
/Users/sourabhgoyal/.oh-my-zsh/plugins/git/git.plugin.zsh:200: command not found: compdef`

@dawoonchung

This comment has been minimized.

Copy link

commented May 18, 2018

Facing the same issue here after the update.

[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x  56 da-woon.chung  admin  1792 May 18 09:50 /usr/local/share
[oh-my-zsh] For safety, completions will be disabled until you manually fix all
[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:81: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:95: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:102: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:115: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:125: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:135: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:144: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:150: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:153: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:156: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:159: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:169: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:172: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:174: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:188: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/git/git.plugin.zsh:200: command not found: compdef
/Users/da-woon.chung/.oh-my-zsh/plugins/yarn/yarn.plugin.zsh:88: command not found: compdef
@ericchuawc

This comment has been minimized.

Copy link

commented May 18, 2018

I did this and it solved the issue

chmod 755 /usr/local/share/zsh
chmod 755 /usr/local/share/zsh/site-functions

Then close and open my iterm, it works.

@sourabh-goyal

This comment has been minimized.

Copy link

commented May 18, 2018

ISSUE SOLVED!! by :
Set ZSH_DISABLE_COMPFIX=true in your zshrc file, before oh-my-zsh.sh is sourced, and update OMZ to the latest version. It should ignore these permission issues and load the completion system normally.

thanks to @mcornella for the solution @ #6461

@lucaim

This comment has been minimized.

Copy link

commented May 18, 2018

@sourabh-goyal that is a good workaround to reenable the completion but it works disabling the check , not solving the issue

@oyoun

This comment has been minimized.

Copy link

commented May 18, 2018

Having the same issue! Same messages

@dompl

This comment has been minimized.

Copy link

commented May 19, 2018

Same here. Any help much appreciated.

@serdardalgic

This comment has been minimized.

Copy link
Contributor

commented May 20, 2018

I have the latest master a600ab4

My OS is OSX El Capitan, Version 10.11.6 (15G20015).

When I added ZSH_DISABLE_COMPFIX=true to my zshrc, tab completion started to work again, but I experienced those issues.

  • Updated completions are not used. E.g. when I write docker it shows the old completions, not the ones that are introduced with, let's say, 919f0a42. To be more precise, docker ins autocompletes to inspect, doesn't give the option to select between ìnspect and ìnstall.

  • git addcommand autocompletes the files that are suitable to be staged, but git add -i command doesn't autocomplete the files.

I guess I need to recreate the hash for the autocompletion but I don't know how I can do it.
I tried rehash command, it didn't work.
unfunction _docker && autoload -U _dockerdidn't help either.

How can I debug the issue further?

@serdardalgic

This comment has been minimized.

Copy link
Contributor

commented May 20, 2018

Sorry for the confusion, Those two issues still exist in the commit cafa657 from which I updated to current master. I'll check those in the issues and if necessary, create new tickets.

@leeeunlim

This comment has been minimized.

Copy link

commented May 21, 2018

Same here.

[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxrwx 0 eunlim eunlim 512 Mar 22 18:31 /home/eunlim/.oh-my-zsh/custom/plugins/zsh-autosuggestions
drwxrwxrwx 0 eunlim eunlim 512 Mar 22 18:31 /home/eunlim/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
[oh-my-zsh] For safety, completions will be disabled until you manually fix all
[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

[oh-my-zsh] Insecure completion caches also detected:
-rw-rw-rw- 1 eunlim eunlim 39206 May 21 10:58 /home/eunlim/.zcompdump
[oh-my-zsh] Moving to "/home/eunlim/.oh-my-zsh/cache/zcompdump-bad/"...
@dompl

This comment has been minimized.

Copy link

commented May 21, 2018

Moderator: don't try this solution, it could damage your system

This worked for me

sudo chown -R $USER:staff /usr/local/*

@mcornella

This comment has been minimized.

Copy link
Collaborator

commented May 21, 2018

The appropriate solution is #6835 (comment). The way zsh completions are loaded, you will get the message even if there is no real security risk. So just enable that flag to ignore it.

@mcornella mcornella closed this May 21, 2018

@stickperson

This comment has been minimized.

Copy link

commented May 21, 2018

Running compaudit | xargs chmod g-w worked for me.

@simplegadget512

This comment has been minimized.

Copy link

commented May 25, 2018

6835 provides a workaround for the issue, but is that really a fix?

Why is oh-my-zsh doing a security audit on things that are pretty clearly not it's responsibility? And who is oh-my-zsh to say that having group write permissions on my homebrew directories is not permissible or even out of line?

@reijin90

This comment has been minimized.

Copy link

commented May 29, 2018

you just have to change the ownership of the omz user folder:
chmod a-wx /home/USER/.oh-my-zsh/custom/plugins/zsh-completions

@pandaa880

This comment has been minimized.

Copy link

commented Jun 27, 2018

It says set
ZSH_DISABLE_COMPFIX=true in .zshrc before you source .oh-my-zsh in your .zshrc file.

So, put
ZSH_DISABLE_COMPFIX=true at the first line of your .zshrc file and then
run source .zshrc..

🔥🔥🔥 It worked for me.

kevin-morgan added a commit to kevin-morgan/dotfiles that referenced this issue Jul 1, 2018

@rassouldev

This comment has been minimized.

Copy link

commented Jul 22, 2018

Last login: Sun Jul 22 12:40:09 on ttys000
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxr-xr-x 3 502 admin 96 Jul 11 10:57 /usr/local/share/zsh
drwxr-xr-x 4 502 admin 128 Jul 11 11:00 /usr/local/share/zsh/site-functions

[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh] compaudit | xargs chmod g-w,o-w

[oh-my-zsh] If the above didn't help or you want to skip the verification of
[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.

Repository owner locked as resolved and limited conversation to collaborators Jul 22, 2018

@mcornella mcornella removed the Type: bug label Jul 22, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.