more reliable way to look up username

`ENV` is manipulable.  `getpwuid` is reliable.
This commit is contained in:
Roland Walker 2014-02-21 09:30:37 -05:00
parent 1fe35b95f5
commit 3ded5898b6
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ class Cask
unless caskroom.exist?
ohai "We need to make Caskroom for the first time at #{caskroom}"
ohai "We'll set permissions properly so we won't need sudo in the future"
current_user = ENV['USER']
current_user = Etc.getpwuid(Process.euid).name
if caskroom.parent.writable?
system '/bin/mkdir', caskroom
else