364
143

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

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のセキュリティオプション

364
143
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
364
143

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?