From f26293bb066189ca8a74167180f6c4a0b7c82197 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 15 Jul 2015 11:04:05 -0700 Subject: [PATCH] hosts/linux: sudo to copy back to exports [GH-5957] --- CHANGELOG.md | 1 + plugins/hosts/linux/cap/nfs.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f795a0436..235f1ea7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ BUG FIXES: - guests/redhat: systemd detection should happen on guest [GH-5948] - guests/ubuntu: setting hostname fixed in 12.04 [GH-5937] - hosts/linux: NFS can be configured without `$TMP` set on the host [GH-5954] + - hosts/linux: NFS will sudo copying back to `/etc/exports` [GH-5957] - providers/virtulabox: remove UNC path conversion on Windows since it caused mounting regressions [GH-5933] - provisioners/puppet: Windows Puppet 4 paths work correctly [GH-5967] diff --git a/plugins/hosts/linux/cap/nfs.rb b/plugins/hosts/linux/cap/nfs.rb index d766980d0..90bf4d27b 100644 --- a/plugins/hosts/linux/cap/nfs.rb +++ b/plugins/hosts/linux/cap/nfs.rb @@ -103,7 +103,7 @@ module VagrantPlugins # Use sed to just strip out the block of code which was inserted # by Vagrant 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") + 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' ; #{sudo_command}cp '#{tmp}/exports' /etc/exports") end def self.nfs_opts_setup(folders)