core: fix jailbreaking of plugins

/cc @sethvargo
This commit is contained in:
Mitchell Hashimoto 2015-07-10 15:34:59 -06:00
parent efe62cfe2a
commit dec5f70a1e
1 changed files with 3 additions and 1 deletions

View File

@ -98,7 +98,9 @@ module Vagrant
# the original environment - this is required for shelling out to # the original environment - this is required for shelling out to
# other subprocesses that depend on environment variables (like Ruby # other subprocesses that depend on environment variables (like Ruby
# and $GEM_PATH for example) # 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...") @logger.info("Command not in installer, restoring original environment...")
jailbreak(process.environment) jailbreak(process.environment)
end end