Skip to content
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

Bug report: LogMeIn-Hamachi Cask installs kernel extension improperly #24786

Closed
Saklad5 opened this issue Sep 23, 2016 · 9 comments · Fixed by #27521
Closed

Bug report: LogMeIn-Hamachi Cask installs kernel extension improperly #24786

Saklad5 opened this issue Sep 23, 2016 · 9 comments · Fixed by #27521

Comments

@Saklad5
Copy link
Contributor

Saklad5 commented Sep 23, 2016

Remember to follow the pre bug report guide beforehand. Failure to do so might get your issue closed.

Description of issue

The command runs “successfully”, but macOS immediately throws an error popup stating that the system extension “ham.kext” was installed improperly. This does not occur when using the same installer manually without Homebrew.

Output of brew cask <command> --verbose

==> Downloading https://secure.logmein.com/LogMeInHamachi.zip
/usr/bin/curl --fail --remote-time --location --user-agent Homebrew/1.0.2-51-g4cbeb1e-dirty (Macintosh; Intel macOS 10.12) curl/7.49.1 https://secure.logmein.com/LogMeInHamachi.zip -C 0 -o /Users/accountname/Library/Caches/Homebrew/Cask/logmein-hamachi--latest.zip.incomplete --silent
==> No checksum defined for Cask logmein-hamachi, skipping verification
==> Running installer script LogMeInHamachiInstaller.app/Contents/MacOS/Lili
==> 2016-09-23 12:30:06.376 Lili[11384:2469650] MessageMap.load: /usr/local/Caskroom/logmein-hamachi/latest/LogMeInHamachiInstaller.app/Contents/Resources/messages.bin
==> + echo 'Starting preflight'
==> + echo 'Stopping user MenuBars'
==> ++ sw_vers -productVersion
==> + pv=10.12
==> + echo 'Stopping root MenuBar (if exists)'
==> + launchctl unload /Library/LaunchAgents/com.logmein.hamachimb.plist
==> /Library/LaunchAgents/com.logmein.hamachimb.plist: No such file or directory
==> + SaveIFS='     
==> '
==> + IFS='\n'
==> ++ ps axo 'user pid command'
==> ++ grep -v grep
==> ++ grep loginwindow
==> ++ tr -s ' '
==> ++ cut -f 1-2 '-d '
==> + for uisession in '`ps axo "user pid command" | grep -v grep | grep loginwindow | tr -s '\'' '\'' | cut -f 1-2 -d'\'' '\''`'
==> ++ echo 'accountname 124'
==> ++ cut -f 1 '-d '
==> + uiusername=accountname
==> ++ echo 'accountname 124'
==> ++ cut -f 2 '-d '
==> + uipid=124
==> + '[' xroot '!=' xaccountname ']'
==> + launchctl bsexec 124 sudo -u accountname launchctl unload /Library/LaunchAgents/com.logmein.hamachimb.plist
==> task_for_pid(): 0x5
==> + sudo -u accountname launchctl unload /Library/LaunchAgents/com.logmein.hamachimb.plist
==> /Library/LaunchAgents/com.logmein.hamachimb.plist: No such file or directory
==> + IFS='     
==> '
==> + sleep 2
==> + echo 'Stopping Engine'
==> + launchctl unload /Library/LaunchDaemons/com.logmein.hamachi.plist
==> /Library/LaunchDaemons/com.logmein.hamachi.plist: No such file or directory
==> + '/Applications/LogMeIn Hamachi/LogMeIn Hamachi.app/Contents/Resources/hamachidaemonctl' stop
==> /usr/local/Caskroom/logmein-hamachi/latest/LogMeInHamachiInstaller.app/Contents/Resources/preflight.sh: line 30: /Applications/LogMeIn Hamachi/LogMeIn Hamachi.app/Contents/Resources/hamachidaemonctl: No such file or directory
==> + echo 'Stopping user Hamachi apps'
==> + case $pv in
==> ++ ps axo 'user pid command'
==> ++ grep loginwindow
==> ++ cut -s '-d ' -f 1
==> + for uiusername in '`ps axo "user pid command" | grep loginwindow | cut -s -d'\'' '\'' -f 1`'
==> + echo accountname
==> + sudo -u accountname killall 'LogMeIn Hamachi.app'
==> No matching processes belonging to you were found
==> + for uiusername in '`ps axo "user pid command" | grep loginwindow | cut -s -d'\'' '\'' -f 1`'
==> + echo root
==> + sudo -u root killall 'LogMeIn Hamachi.app'
==> No matching processes were found
==> + echo 'Stopping root Hamachi apps (if exists)'
==> + killall 'LogMeIn Hamachi'
==> No matching processes were found
==> + echo 'Unloading kext'
==> + kextunload /Library/Extensions/ham.kext
==> Can't open CFBundle for /Library/Extensions/ham.kext.
==> Can't create /Library/Extensions/ham.kext.
==> + kextunload /Library/Extensions/ham.kext
==> Can't open CFBundle for /Library/Extensions/ham.kext.
==> Can't create /Library/Extensions/ham.kext.
==> + echo 'End preflight'
==> + exit 0
==> No matching processes were found
==> ln: /usr/bin/hamachi: Operation not permitted
==> mkdir: /usr/local/bin/cat: File exists
==> /usr/local/Caskroom/logmein-hamachi/latest/LogMeInHamachiInstaller.app/Contents/Resources/postflight.sh: line 22: /usr/sbin/bin/chown: No such file or directory
==> /usr/local/Caskroom/logmein-hamachi/latest/LogMeInHamachiInstaller.app/Contents/Resources/postflight.sh: line 23: /usr/sbin/bin/chown: No such file or directory
==> mv: rename /Library/Extensions/hamns.kext to /System/Library/Extensions/hamns.kext: Directory not empty
==> /usr/local/Caskroom/logmein-hamachi/latest/LogMeInHamachiInstaller.app/Contents/Resources/postflight.sh: line 27: /usr/sbin/bin/chown: No such file or directory
==> /usr/local/Caskroom/logmein-hamachi/latest/LogMeInHamachiInstaller.app/Contents/Resources/postflight.sh: line 28: /usr/sbin/bin/chown: No such file or directory
==> cat: /tmp/hamachi_deploy_id: No such file or directory
==> rm: /tmp/hamachi_deploy_id: No such file or directory
==> rm: /tmp/hamachi_deploy_id.bak: No such file or directory
==> task_for_pid(): 0x5
==> /Library/LaunchAgents/com.logmein.hamachimb.plist: Path had bad ownership/permissions
🍺  logmein-hamachi was successfully installed!

Output of brew doctor

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:
    libarchive

Output of brew cask doctor

==> macOS Release:
10.12
==> Hardware Architecture:
intel-64
==> Ruby Version:
2.0.0-p648
==> Ruby Path:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
==> Homebrew Version:
Homebrew 1.0.2-51-g4cbeb1e-dirty
Homebrew/homebrew-core (git revision 643a; last commit 2016-09-23)
==> Homebrew Executable Path:
/usr/local/bin/brew
==> Homebrew Cellar Path:
/usr/local/Cellar
==> Homebrew Repository Path:
/usr/local/Homebrew
==> Homebrew Origin:
https://github.com/Homebrew/brew.git
==> Homebrew-Cask Version:
0.60.0 (git revision 508c3; last commit 4 hours ago)
==> Homebrew-Cask Install Location:
<NONE>
==> Homebrew-Cask Staging Location:
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads:
/Users/accountname/Library/Caches/Homebrew/Cask
0 files, 0B
==> Homebrew-Cask Default Tap Path:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask
==> Homebrew-Cask Alternate Cask Taps:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-fonts
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions
==> Homebrew-Cask Default Tap Cask Count:
3327
==> Contents of $LOAD_PATH:
/usr/local/Homebrew/Library/Homebrew/cask/lib
/usr/local/Homebrew/Library/Homebrew
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin16
/Library/Ruby/Site/2.0.0/universal-darwin16
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16
==> Contents of $RUBYLIB Environment Variable:
<NONE>
==> Contents of $RUBYOPT Environment Variable:
<NONE>
==> Contents of $RUBYPATH Environment Variable:
<NONE>
==> Contents of $RBENV_VERSION Environment Variable:
<NONE>
==> Contents of $CHRUBY_VERSION Environment Variable:
<NONE>
==> Contents of $GEM_HOME Environment Variable:
<NONE>
==> Contents of $GEM_PATH Environment Variable:
<NONE>
==> Contents of $BUNDLE_PATH Environment Variable:
<NONE>
==> Contents of $PATH Environment Variable:
PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Library/TeX/texbin:/usr/local/sbin:/usr/local/go/bin:/usr/local/Homebrew/Library/Homebrew/cask/cmd:/usr/local/Homebrew/Library/Homebrew/shims/scm"
==> Contents of $SHELL Environment Variable:
SHELL="/usr/local/bin/bash"
==> Contents of Locale Environment Variables:
LANG="en_US.UTF-8"
==> Running As Privileged User:
No

@Saklad5
Copy link
Contributor Author

Saklad5 commented Sep 23, 2016

I replaced my user account with “accountname” in the outputs, but they are otherwise unmodified.

@numbermaniac
Copy link
Contributor

Link for the lazy: https://github.com/caskroom/homebrew-cask/blob/master/Casks/logmein-hamachi.rb

@numbermaniac
Copy link
Contributor

numbermaniac commented Sep 24, 2016

I noticed this when I ran it manually using sudo:

+ echo 'Unloading kext'
+ kextunload /Library/Extensions/ham.kext
Can't open CFBundle for /Library/Extensions/ham.kext.
Can't create /Library/Extensions/ham.kext.
+ kextunload /Library/Extensions/ham.kext
Can't open CFBundle for /Library/Extensions/ham.kext.
Can't create /Library/Extensions/ham.kext.
+ echo 'End preflight'
+ exit 0
No matching processes were found
ln: /usr/bin/hamachi: Operation not permitted

@vitorgalvao vitorgalvao added the awaiting user reply Issue needs response from a user. label Sep 24, 2016
@vitorgalvao
Copy link
Member

Can reproduce.

Furthermore, if run their own command manually, this problem does not occur.

This means it is likely a bug in the way installer script: is behaving.

@vitorgalvao vitorgalvao added bug Issue describing a reproducible bug. awaiting maintainer feedback Issue needs response from a maintainer. cask and removed awaiting user reply Issue needs response from a user. labels Sep 24, 2016
@Saklad5
Copy link
Contributor Author

Saklad5 commented Dec 9, 2016

Nope, still happening.

@vitorgalvao
Copy link
Member

vitorgalvao commented Dec 9, 2016

@Saklad5 The current method doesn’t install anything automatically for you, it just tells you to manually run the installer, so if any issue is happening, it’s out of our hands and you need to talk to the developers.

@Saklad5
Copy link
Contributor Author

Saklad5 commented Dec 9, 2016

I know, but the installer works fine when I download and install it entirely manually. Perhaps it has something to do with the install directory?

@Saklad5
Copy link
Contributor Author

Saklad5 commented Dec 9, 2016

By the way, shouldn’t the Cask automatically open the installer rather than telling you to do it? That’s what a few of the other Casks do, right?

@miccal
Copy link
Member

miccal commented Dec 9, 2016

Read the documentation and see this issue.

@miccal miccal removed the awaiting maintainer feedback Issue needs response from a maintainer. label Dec 15, 2016
@miccal miccal removed bug Issue describing a reproducible bug. cask labels Dec 23, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants