From aca273c996c4c0cca6f6a6975373601e3b356527 Mon Sep 17 00:00:00 2001 From: "Felix C. Stegerman" Date: Mon, 24 Nov 2014 02:26:54 +0100 Subject: [PATCH 1/2] fix broken tempdir removal --- lib/vagrant/bundler.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index 05867da15..458bd3a0c 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -1,3 +1,4 @@ +require "fileutils" require "monitor" require "pathname" require "set" @@ -79,7 +80,7 @@ module Vagrant # Removes any temporary files created by init def deinit - File.unlink(ENV["BUNDLE_APP_CONFIG"]) rescue nil + FileUtils.remove_entry_secure(ENV["BUNDLE_APP_CONFIG"]) rescue nil File.unlink(ENV["BUNDLE_CONFIG"]) rescue nil File.unlink(ENV["GEMFILE"]) rescue nil end From 023e4b8c2309e15e7d6ee78407baa7e0fd31ae27 Mon Sep 17 00:00:00 2001 From: "Felix C. Stegerman" Date: Mon, 24 Nov 2014 16:58:59 +0100 Subject: [PATCH 2/2] force rm tempfiles (no rescue nil); use right var --- lib/vagrant/bundler.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index 458bd3a0c..dfe8a17c1 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -80,9 +80,9 @@ module Vagrant # Removes any temporary files created by init def deinit - FileUtils.remove_entry_secure(ENV["BUNDLE_APP_CONFIG"]) rescue nil - File.unlink(ENV["BUNDLE_CONFIG"]) rescue nil - File.unlink(ENV["GEMFILE"]) rescue nil + %w{ BUNDLE_APP_CONFIG BUNDLE_CONFIG BUNDLE_GEMFILE }.each do |entry| + FileUtils.remove_entry_secure(ENV[entry], true) + end end # Installs the list of plugins.