From bfbf96c385056e0ac721982f7ce338af019f2b48 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Mon, 13 Jul 2015 10:40:28 -0400 Subject: [PATCH] Fallback to /tmp if $TMPDIR is not set --- plugins/hosts/linux/cap/nfs.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/hosts/linux/cap/nfs.rb b/plugins/hosts/linux/cap/nfs.rb index a55d8acb2..d766980d0 100644 --- a/plugins/hosts/linux/cap/nfs.rb +++ b/plugins/hosts/linux/cap/nfs.rb @@ -102,7 +102,8 @@ module VagrantPlugins # Use sed to just strip out the block of code which was inserted # by Vagrant - system("cp /etc/exports $TMPDIR && #{sudo_command}sed -r -e '\\\x01^# VAGRANT-BEGIN:( #{user})? #{id}\x01,\\\x01^# VAGRANT-END:( #{user})? #{id}\x01 d' -ibak $TMPDIR/exports ; cp $TMPDIR/exports /etc/exports") + tmp = ENV["TMPDIR"] || ENV["TMP"] || "/tmp" + system("cp /etc/exports '#{tmp}' && #{sudo_command}sed -r -e '\\\x01^# VAGRANT-BEGIN:( #{user})? #{id}\x01,\\\x01^# VAGRANT-END:( #{user})? #{id}\x01 d' -ibak '#{tmp}/exports' ; cp '#{tmp}/exports' /etc/exports") end def self.nfs_opts_setup(folders)