aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
-rw-r--r--Library/Homebrew/extend/pathname.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index cb76c8910..c9c233144 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -110,8 +110,11 @@ class Pathname
FileUtils.mv tf.path, self
+ uid = Process.uid
+ gid = Process.groups.delete(old_stat.gid) { Process.gid }
+
begin
- chown(old_stat.uid, old_stat.gid)
+ chown(uid, gid)
chmod(old_stat.mode)
rescue Errno::EPERM
end