diff options
| author | Max Howell | 2011-08-31 11:24:56 +0100 |
|---|---|---|
| committer | Max Howell | 2012-03-09 12:10:50 +0000 |
| commit | 98ec342ecc597d0bb2806fbd2a5fafb796caf8ed (patch) | |
| tree | f933963d74233a8c2f14404de88f64c26525a4cc | |
| parent | cadc0506f9e94f17f522fdd5c14cfb8bbf228d9b (diff) | |
| download | brew-98ec342ecc597d0bb2806fbd2a5fafb796caf8ed.tar.bz2 | |
Use admin group and not staff
Staff is overly permissive, require user to be an Administrator to use Homebrew.
| -rw-r--r-- | install_homebrew.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/install_homebrew.rb b/install_homebrew.rb index 07485e4d3..f17036a14 100644 --- a/install_homebrew.rb +++ b/install_homebrew.rb @@ -74,13 +74,11 @@ Dir.chdir "/usr" abort "MacOS too old, see: https://gist.github.com/1144389" if macos_version < 10.5 abort "/usr/local/.git already exists!" unless Dir["/usr/local/.git/*"].empty? abort "Don't run this as root!" if Process.uid == 0 -abort <<-EOABORT unless `groups`.split.include? "staff" -This script requires the user #{ENV['USER']} to be in the staff group. If this +abort <<-EOABORT unless `groups`.split.include? "admin" +This script requires the user #{ENV['USER']} to be an Administrator. If this sucks for you then you can install Homebrew in your home directory or however you please; please refer to the website. If you still want to use this script -the following command should work: - - dscl /Local/Default -append /Groups/staff GroupMembership $USER +set your user to be an Administrator in System Preferences or `su'. EOABORT ohai "This script will install:" @@ -101,7 +99,7 @@ unless chmods.empty? puts *chmods end unless chgrps.empty? - ohai "The following directories will have their group set to #{Tty.underline 39}staff#{Tty.reset}:" + ohai "The following directories will have their group set to #{Tty.underline 39}admin#{Tty.reset}:" puts *chgrps end @@ -113,13 +111,12 @@ end if File.directory? "/usr/local" sudo "/bin/chmod", "g+rwx", *chmods unless chmods.empty? - # all admin users are in staff - sudo "/usr/bin/chgrp", "staff", *chgrps unless chgrps.empty? + sudo "/usr/bin/chgrp", "admin", *chgrps unless chgrps.empty? else sudo "/bin/mkdir /usr/local" sudo "/bin/chmod g+rwx /usr/local" # the group is set to wheel by default for some reason - sudo "/usr/bin/chgrp staff /usr/local" + sudo "/usr/bin/chgrp admin /usr/local" end Dir.chdir "/usr/local" do |
