The default shell for MacOsx, starting with Catalina OS, is no longer .bash but is now .zsh. While you can easily change back to bash if you prefer, zsh does have some updated features that make it a solid shell. It also has a few quirks.
One of the quirks is how it deals with autocomplete — you know, type a few letters and hit the tab key? Zsh uses a utiity called compaudit to generate an index of your filesystem to help speed up the process. I first became aware of this when I updated my .zshrc and began seeing this error every time I opened a new shell:
zsh compinit: insecure directories and files, run compaudit for list.
Ignore insecure directories and files and continue [y] or abort compinit [n]?
After digging around a bit, I discovered that the utility was coming across what it considered security risks — key directories with group and other write access. Running compaudit showed me a short list of directories, none of which I had explicitly opened up write access on. I found one option to follow the shell’s advice and lock them down.
Option 1: lock down the directories
compaudit | xargs chmod g-w,o-w
Another option was to turn off this heightened security setting within the shell.
Option 2: disable compfix
ZSH_DISABLE_COMPFIX="true"
I tend to avoid arbitrarily changing permissions on directories, especially system directories, and I went with the second option.
© 2022, Angela Smith. All rights reserved.