From f8909dcbfa08d466b742a7a29b6d7be868a555c1 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 17 Jul 2010 09:58:30 -0700 Subject: [PATCH] Fix `sed` calls for linux and add proper options for the UID/GID mapping. --- lib/vagrant/hosts/linux.rb | 2 +- templates/nfs/exports_linux.erb | 2 +- vagrant.gemspec | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/hosts/linux.rb b/lib/vagrant/hosts/linux.rb index 7d556961a..023c213f3 100644 --- a/lib/vagrant/hosts/linux.rb +++ b/lib/vagrant/hosts/linux.rb @@ -42,7 +42,7 @@ module Vagrant if $?.to_i == 0 # Use sed to just strip out the block of code which was inserted # by Vagrant - system("sudo sed -e '/^# VAGRANT-BEGIN: #{env.vm.uuid}/,/^# VAGRANT-END: #{env.vm.uuid}/ d' -i bak /etc/exports") + system("sudo sed -e '/^# VAGRANT-BEGIN: #{env.vm.uuid}/,/^# VAGRANT-END: #{env.vm.uuid}/ d' -ibak /etc/exports") end end end diff --git a/templates/nfs/exports_linux.erb b/templates/nfs/exports_linux.erb index 6eab88c1b..4566b0ca7 100644 --- a/templates/nfs/exports_linux.erb +++ b/templates/nfs/exports_linux.erb @@ -1,3 +1,3 @@ # VAGRANT-BEGIN: <%= uuid %> -<% folders.each do |name, opts| %><%= opts[:hostpath] %> <%= ip %>(rw<% if opts[:map_uid] %>,anonuid=<%= opts[:map_uid] %><% end %><% if opts[:map_gid] %>,anongid=<%= opts[:map_gid] %><% end %>)<% end %> +<% folders.each do |name, opts| %><%= opts[:hostpath] %> <%= ip %>(rw,no_subtree_check,all_squash<% if opts[:map_uid] %>,anonuid=<%= opts[:map_uid] %><% end %><% if opts[:map_gid] %>,anongid=<%= opts[:map_gid] %><% end %>)<% end %> # VAGRANT-END: <%= uuid %> \ No newline at end of file diff --git a/vagrant.gemspec b/vagrant.gemspec index 8756a9098..f0c0eca3c 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -119,6 +119,7 @@ Gem::Specification.new do |s| "templates/chef_solo_solo.erb", "templates/network_entry.erb", "templates/nfs/exports.erb", + "templates/nfs/exports_linux.erb", "templates/package_Vagrantfile.erb", "templates/ssh_config.erb", "templates/strings.yml", @@ -186,6 +187,7 @@ Gem::Specification.new do |s| "test/vagrant/environment_test.rb", "test/vagrant/hosts/base_test.rb", "test/vagrant/hosts/bsd_test.rb", + "test/vagrant/hosts/linux_test.rb", "test/vagrant/provisioners/base_test.rb", "test/vagrant/provisioners/chef_server_test.rb", "test/vagrant/provisioners/chef_solo_test.rb", @@ -256,6 +258,7 @@ Gem::Specification.new do |s| "test/vagrant/systems/linux_test.rb", "test/vagrant/config_test.rb", "test/vagrant/hosts/base_test.rb", + "test/vagrant/hosts/linux_test.rb", "test/vagrant/hosts/bsd_test.rb", "test/vagrant/active_list_test.rb", "test/vagrant/commands/base_test.rb",