mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
utils/gems: handle mismatching EUID and UID for bundle installs
This commit is contained in:
parent
a5a915043b
commit
1e7cf514eb
@ -32,7 +32,6 @@ module Homebrew
|
|||||||
Homebrew.forget_user_gem_groups!
|
Homebrew.forget_user_gem_groups!
|
||||||
end
|
end
|
||||||
|
|
||||||
Process::UID.change_privilege(Process.euid) if Process.euid != Process.uid
|
|
||||||
Homebrew.install_bundler_gems!(groups:)
|
Homebrew.install_bundler_gems!(groups:)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -300,7 +300,12 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
bundle_installed = if bundle_install_required
|
bundle_installed = if bundle_install_required
|
||||||
if system bundle, "install", out: :err
|
Process.wait(fork do
|
||||||
|
# Native build scripts fail if EUID != UID
|
||||||
|
Process::UID.change_privilege(Process.euid) if Process.euid != Process.uid
|
||||||
|
exec bundle, "install", out: :err
|
||||||
|
end)
|
||||||
|
if $CHILD_STATUS.success?
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
message = <<~EOS
|
message = <<~EOS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user