141
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

macでzshでzsh compinit: insecure directoriesの警告が出る問題

macOSをsierraにしてzshを入れ直したらこんな警告がでるようになってしまった

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

「ディレクトリが安全でないから,compauditで確認してね」みたいな感じらしい
実行してみると以下のように

% compaudit
There are insecure directories:
/usr/local/share/zsh/site-functions
/usr/local/share/zsh

なるほど,この2つのディレクトリが安全でないらしい

% cd /usr/local/share/zsh
% ls -la
total 0
drwxrwxr-x    6 ayihis  admin    204  9 21 18:28 ./
drwxrwxr-x   14 ayihis  admin    476  9 22 15:29 ../
drwxr-xr-x  982 ayihis  admin  33388  9 21 18:28 functions/
drwxr-xr-x  110 ayihis  admin   3740  9 21 18:28 help/
drwxr-xr-x    3 ayihis  admin    102  9 21 18:28 scripts/
drwxrwxr-x    6 ayihis  admin    204  9 22 15:29 site-functions/

とりあえず,site-functionの方の権限を変更してみる

% chmod 755 site-functions/     

これでターミナルを開き直してみる

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]? y
%
% compaudit
There are insecure directories:
/usr/local/share/zsh

お,減ってるね!
ということで,

% chmod 755 /usr/local/share/zsh

これで警告消えました.
めでたしめでたし!たぶん!

参考

zsh のセットアップ
How to fix “zsh compinit: insecure directories”?
[zsh] compinitのセキュリティオプション

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
141
Help us understand the problem. What are the problem?