zsh compinit: insecure directories

前端 未结 23 2177
攒了一身酷
攒了一身酷 2021-01-29 17:22

What does it mean and how can I fix it?

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compini         


        
相关标签:
23条回答
  • 2021-01-29 17:58

    I got the same warnings when I sudo -i starting a root shell, @chakrit's solution didn't work for me.

    But I found -u switch of compinit works, e.g. in your .zshrc/zshenv or where you called compinit

    compinit -u
    

    NB: Not recommended for production system

    See also http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Initialization

    0 讨论(0)
  • 2021-01-29 17:58

    on Mojave, this did the trick : sudo chmod go-w /usr/local/share

    0 讨论(0)
  • 2021-01-29 17:59

    This was the only thing that worked for me from https://github.com/zsh-users/zsh-completions/issues/433#issuecomment-600582607. Thanks https://github.com/malaquiasdev!

      $ cd /usr/local/share/
      $ sudo chmod -R 755 zsh
      $ sudo chown -R root:staff zsh
    
    0 讨论(0)
  • 2021-01-29 18:00

    This answer is mostly a reference for myself to use in the future, as most answers do not provide a full-fledged solution. Here it is:

    First run:

    compinit
    

    For every single path that is printed run the following the commands:

    sudo chown $(whoami) PATH_HERE
    
    sudo chmod -R 755 PATH_HERE
    

    Simple example, let's say one of the paths that gets printed after running compinit is "/usr/local/share/zsh". Then:

    sudo chown $(whoami) /usr/local/share/zsh
    
    sudo chmod -R 755 /usr/local/share/zsh
    
    0 讨论(0)
  • 2021-01-29 18:00

    MAC OS X solution :

    $ sudo chmod -R 755 /usr/local/share/zsh
    $ sudo chown -R root:staff /usr/local/share/zsh
    

    Also "user:staff = default root user on OSX.

    0 讨论(0)
提交回复
热议问题