From dec5f70a1e9a27f4c9e5065e966fce7f055878fa Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 10 Jul 2015 15:34:59 -0600 Subject: [PATCH] core: fix jailbreaking of plugins /cc @sethvargo --- lib/vagrant/util/subprocess.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index 24da54977..d69286b33 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -98,7 +98,9 @@ module Vagrant # the original environment - this is required for shelling out to # other subprocesses that depend on environment variables (like Ruby # and $GEM_PATH for example) - if !@command[0].downcase.include?(installer_dir) + internal = [installer_dir, Vagrant.user_data_path.to_s.downcase]. + any? { |path| @command[0].downcase.include?(path) } + if !internal @logger.info("Command not in installer, restoring original environment...") jailbreak(process.environment) end