root auto-taps should be done as Homebrew user

Closes https://github.com/Homebrew/brew/issues/14263.
This commit is contained in:
Adrian Ho 2022-12-19 18:06:09 +08:00
parent 884c4bec14
commit a76451602d

View File

@ -125,6 +125,7 @@ begin
with_env HOMEBREW_HELP: nil do
tap_commands = []
if File.exist?("/.dockerenv") ||
Process.uid.zero? ||
((cgroup = Utils.popen_read("cat", "/proc/1/cgroup").presence) &&
%w[azpl_job actions_job docker garden kubepods].none? { |type| cgroup.include?(type) })
brew_uid = HOMEBREW_BREW_FILE.stat.uid