LoginSignup
13
11

More than 5 years have passed since last update.

Cygwin 上の zsh compinit の insecure directories 警告を抑止する

Last updated at Posted at 2015-01-14

概要

Cygwin 上で zsh を使おうとすると

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

のような鬱陶しいメッセージが出ることがあるのでこれを抑止する。
(一応 Cygwin 環境以外にも適用できる方法のはず。)

解法

compaudit で表示されたディレクトリを chmod g-w する。ただし、グループが「なし」になっていると何も起こらないので事前に chgrp しておく(ここが Cygwin (Windows) 特有の問題)(ここではとりあえず Users グループを利用する)。

% compaudit
There are insecure directories:
/usr/share/zsh/site-functions
/usr/share/zsh/5.0.6/functions
/usr/share/zsh
/usr/share/zsh/5.0.6
% cd /usr/share/zsh
% chgrp -R Users .
% chmod -R g-w .
% compaudit

別解

.zshrc 内の compinit-u オプション(シェルスクリプトが安全かどうかのチェックをしないオプション)を付ける。

autoload -Uz compinit
compinit -u

セキュリティ的に怪しい気もする(そこまで気にする必要があるのかどうかはよくわからないが)。.zshrc を他マシンでも使い回しているので個人的には微妙。

参考

13
11
0

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
13
11