Search code examples
macosshellsecurityzshzshrc

MacOS, insecure files/directory (zsh compinit)


My shell tells me the following:

❯ compaudit
There are insecure files:
/usr/local/share/zsh/site-functions/_brew

I tried fixing this using $ sudo chmod -R 755 /usr/local/share/zsh/site-functions/_brew and $ sudo chown -R root:staff /usr/local/share/zsh/site-functions/_brew but that didnt help. The only other solution I have found was to add ZSH_DISABLE_COMPFIX=true into my ~./zshrc file. But isnt that just a workaround to ignore the problem?


Solution

  • I found the solution: The file that was making problems (/usr/local/share/zsh/site-functions/_brew) was linking to another file (/usr/local/Homebrew/completions/zsh/_brew).
    So I ran these 2 commands and I was fine:

    $ sudo chmod -R 755 /usr/local/Homebrew/completions/zsh/_brew
    $ sudo chown -R root:staff /usr/local/Homebrew/completions/zsh/_brew