Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

homebrew makes zsh dirs insecure; nvm exposes this in bash_completion: need readme info! #2361

Closed
seishun opened this issue Nov 26, 2020 · 5 comments
Labels
informational OS: Mac OS pull request wanted This is a great way to contribute! Help us out :-D shell: zsh

Comments

@seishun
Copy link

seishun commented Nov 26, 2020

Operating system and version:

macOS 10.15.7

nvm debug output:

nvm --version: v0.37.1
$TERM_PROGRAM: Apple_Terminal
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'nikolajsvavilovs'
${HOME}: /Users/nikolajsvavilovs
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.7.1 (x86_64-apple-darwin19.0)'
uname -a: 'Darwin 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64'
checksum binary: 'shasum'
OS version: Mac 10.15.7 19H2
curl: /usr/bin/curl, curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2
wget: not found
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: /bin/rm
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /usr/local/bin/git, git version 2.29.2
grep: /usr/bin/grep, grep (BSD grep) 2.5.1-FreeBSD
awk: /usr/bin/awk, awk version 20070501
nvm current: none
which node: node not found
which iojs: iojs not found
which npm: npm not found
npm config get prefix: nvm:279: command not found: npm
npm root -g: nvm:279: command not found: npm

nvm ls output:

            N/A
iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)
nvm_list_aliases:36: no matches found: /Users/nikolajsvavilovs/.nvm/alias/lts/*

How did you install nvm?

Install script in readme.

What steps did you perform?

  1. Run the install script
  2. touch ~/.zshrc
  3. Run the install script again

What happened?

When opening a new terminal, the following appears:

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

What did you expect to happen?

A mention of this in the readme with mitigation steps.

Is there anything in any of your profile files that modifies the PATH?

Probably not since it's a fresh macOS install.

@ljharb
Copy link
Member

ljharb commented Nov 27, 2020

What happens when you run compaudit?

@ljharb ljharb added needs followup We need some info or action from whoever filed this issue/PR. OS: Mac OS shell: zsh labels Nov 27, 2020
@seishun
Copy link
Author

seishun commented Nov 27, 2020

There are insecure directories:
/usr/local/share/zsh/site-functions
/usr/local/share/zsh

@ljharb
Copy link
Member

ljharb commented Nov 27, 2020

Those are your own dirs, not nvm’s - it seems like zsh-users/zsh-completions#680 is the cause, and a few solutions are listed. Does that solve the problem?

@seishun
Copy link
Author

seishun commented Nov 27, 2020

So apparently Homebrew breaks permissions on those two directories, but the issue becomes apparent after running nvm install script. Since this might happen to other people installing nvm, it would be helpful to mention it in the readme so that they don't have to wonder what they did wrong and then spend a lot of time figuring out the right solution.

@ljharb
Copy link
Member

ljharb commented Nov 27, 2020

That sounds like a great idea - a PR would be appreciated!

@ljharb ljharb added informational pull request wanted This is a great way to contribute! Help us out :-D and removed needs followup We need some info or action from whoever filed this issue/PR. labels Nov 27, 2020
@ljharb ljharb changed the title Installation instructions "break" zsh on Mac homebrew makes zsh dirs insecure; nvm exposes this in bash_completion: need readme info! Nov 27, 2020
@ljharb ljharb closed this as completed in 6982dee Dec 29, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
informational OS: Mac OS pull request wanted This is a great way to contribute! Help us out :-D shell: zsh
Projects
None yet
Development

No branches or pull requests

3 participants
@ljharb @seishun and others