-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zsh compinit: insecure directories and files, run compaudit for list. #433
Comments
@k-lam Don’t have a solution but maybe a good hint: see http://stackoverflow.com/questions/13762280/zsh-compinit-insecure-directories ..you might need to change the directory ownership/rights. |
|
So here is what I did,
Above is my original solution, which doesn't seem to work for some people. Check the other solution proposed by @pine-byte |
@lebensterben your solution worked for me, thanks. |
@lebensterben Hello, after i tried your solution, i got following error. and i don't know what happened with that? can u help me? i ran to step 2: sudo chown -R username:root /usr/local/share/zsh/site-functions then the terminal outputs: chown: root: illegal group name i also tried google this error and tried other solutions: but got same error too, it let me so confusing. this is my users & groups screenshots: thanks in advanced. |
@vuchan The file is a link, you must set on current dir ,and you can see your group by command |
@mqzi thanks for your comment
it works, thanks again @mqzi . |
@vuchan you save my day, thank you |
if your sure the user who is logged in should have permission you could try for f in this will set the ownership correctly for every folder / file listed in the output of compaudit |
This is closed, but nothing work to me. My machine is a MacBook Pro (15-inch, 2019) with macOS Catalina. The solution below, works well:
Sorry to comment in a closed issue. |
this worked fine for me. it fixed 5 out fo 7 files. I fixed the other two files using
|
This was broken for me as well on a fresh install of Catalina with brew, I believe this should be reopened as the steps to add: if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
autoload -Uz compinit
compinit
fi to .zshrc don't mention that for f in $(compaudit);do sudo chmod -R 755 $f;done; needs to be run to avoid getting the error below:
|
just run shell follows: |
SOLUTION (for me)Reinstalling zsh via brew did it for me.
I then got an error saying brew was already installed, I just needed to link to it, and gave me this command:
I had tried to replace the links for original files, thinking it would fix my permissions error, but brew gave an error saying there's files there that need to be overwritten and told me to run this command.
After that. All my errors were gone. |
This worked for me on a new Mac (Catalina) |
This one worked for me 👍 |
Add the following code to fixZsh() {
for f in $(compaudit)
do
sudo chown -R $(whoami):root $f
sudo chmod -R 755 $f
done
} reload terminal && exec |
This works for me!!! |
I just run:
for every directory listed by |
I tried to explain what is the (simple) cause for that here: https://stackoverflow.com/a/63447799/687896 , so that we don't start just typing commands we don't really understand what is going on. Basically, ZSH expects system files to be owned and modifiable (w) by either you (the one running the shell) or root. |
compaudit | xargs chmod g-w |
This work for me. Thank you @pine-byte !!! |
I had to add |
I got this error after installing Yarn or NVM on MacOS. I don't even use ZSH and I don't understand why it was installed. I tried #433 (comment) and it didn't change anything. |
Worked for me after a fresh macOS Big Sur install! No longer getting the warning. |
I got the same error as @givingwu. (illegal group name) But just running the chmod command in step 3 on each directory worked for me to enable the autocomplete. (on Mac OS 10.15.6) |
I hope folks read the thread a bit before recursively and unnecessarily chmodding a bunch of random stuff with +x. You really just want to remove group write permission, which is the Not that there's a big scary downside or anything. But insofar as the files have "correct" permissions, not everything is "supposed" to have the executable bit set. Probably harmless in most/all situations, but if you're trying to understand and fix the problem, it's that the indicated files have the group writable bit set, and that's the thing you're changing with
|
Does nothing:
:D |
Where it says Then if you have more insecure directories do the same, like in my case this folder only |
Thank you for this solution. I'd just like to add, if you have admin privileges you shouldn't have to use sudo. As well, only the top level directory needs to be secured. So for example if the directories that are insecure are ⤵︎
then you only have to secure For anyone wondering, 755 is a flag for chmod that does the following ⤵︎ |
that worked for me as well, thank you |
work for me |
sudo chmod -R 755 on the offending folder was enough for me! |
Just so people know, the magical |
If you are installing
|
Works for me (Catalina with Homebrew 2.7.5). Thanks a lot. |
Works for me! Thanks! |
I'm on bigsur and this #433 (comment) worked for me. |
On macOS Catalina, the below worked for me as
|
Run
|
Use |
My problem was my |
This is still not solved! I make it a habit to NOT work with a user with admin rights. If I change the rights for the compaudit to be clear, I can't update or use homebrew anymore. It will outright reject doing anything. What can I do with a admin user and a non-admin user to not get this output on either users? |
Executing with an empty list. |
All of the proposed solutions did not work for me. What I finally did is uninstalling brew by running: |
Just reinstall brew with the script on their site works for me on the current user. In my situation, I've got multiple users on one laptop with one of them having installed brew. When the other references and uses brew autocompletions on login, I get zsh's insecure directories message. Seems like all users are in the proper groups and there are no write permissions for those groups, so not sure what the problem is. I don't want to change the owners of the files since I want both users to be able to utilize brew autocompletions. |
then just make sure users are not going to do businness with files that belongs to another user |
Works for me run the follow commands:
"compaudit" for the list of insecure (target_directory) |
You want to use:
To disable the annoying permissions test. It doesn't add any security on macOS. See the documentation at |
Yessss, it's the correct way. Thanks you bro! |
I use oh-my-zsh, and I has followed the document.
but when I open a new termial on my Mac,it print
Ignore insecure directories and files and continue [y] or abort compinit [n]?
The text was updated successfully, but these errors were encountered: