Linux

zsh insecure-completion-dependent warning

PSAwesome 2024. 12. 20. 20:06
반응형

안녕하세요.

zsh를 켤 때 아래와 같은 문구가 확인될 때, 해결한 방법입니다.

[oh-my-zsh] Insecure completion-dependent directories detected:
lrwxr-xr-x  1 auto  admin  69 12 20 19:52 /opt/homebrew/share/zsh/site-functions/_docker -> /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion

[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh]     compaudit | xargs chmod g-w,o-w

[oh-my-zsh] If the above didn't help or you want to skip the verification of
[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.

 

ls -ld /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion

-rw-r--r--@ 1 502  staff  129545  6  5  2023 /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion

현재 디렉토리의 권한이 502로 되어있는데, 이건 root를 의미합니다.

아래와 같은 명령어로 직접 수정하면 warning은 사라지게 됩니다.

sudo chown $USER /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion

 

 

감사합니다.

반응형