oh-my-zsh 每次打開出現 zsh compinit: insecure files, run compaudit for list. Ignore insecure files and continue [y] or abort compinit [n]? 問題


具體問題描述如下, 沒什么屁用

Last login: Wed Nov 24 16:45:07 on ttys007
[oh-my-zsh] Insecure completion-dependent directories detected:
lrwxr-xr-x  1 root  staff  39  9 12 21:07 /usr/local/share/zsh/site-functions/_brew -> ../../../Homebrew/completions/zsh/_brew
lrwxr-xr-x  1 root  staff  88 10  1 11:18 /usr/local/share/zsh/site-functions/_brew_services -> ../../../Homebrew/Library/Taps/homebrew/homebrew-services/completions/zsh/_brew_services

[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.

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

在網上搜了辦法, 如 https://stackoverflow.com/questions/13762280/zsh-compinit-insecure-directories,

一般就兩步
$ sudo chmod -R 755 /usr/local/share/zsh/site-functions

$ sudo chown -R root:root /usr/local/share/zsh/site-functions

但他們只能解決簡單的 zshzsh/site-functions 這兩個目錄的安全性問題,

解決不了

_brew
_brew_services
(用 compaudit 命令查看的不安全目錄)

這兩個目錄的的安全問題

最后在這上面找到了解決辦法, 這位老哥的這兩個目錄同樣遇到了這個問題

https://www.cnblogs.com/r1char/p/13095123.html

執行 sudo chown root /usr/local/share/zsh/site-functions/_brew

_brew_services 同理執行, 完事就好了, 這倆命令有啥不一樣可以擇時再學習;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM