From 3631b250b751e49296412be3f6b1cd069e54f6d3 Mon Sep 17 00:00:00 2001 From: Michael Hahn Date: Thu, 6 Feb 2014 13:59:56 -0800 Subject: [PATCH 1/2] Fix #2945: Reference correct options variable --- plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb b/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb index c557097e6..f098dc288 100644 --- a/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +++ b/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb @@ -64,7 +64,7 @@ module VagrantPlugins # Chown the directory to the proper user. We skip this if the # mount options contained a readonly flag, because it won't work. - if !opts[:mount_options].include?("ro") + if !options[:mount_options].include?("ro") chown_commands = [] chown_commands << "chown #{mount_uid}:#{mount_gid} #{expanded_guest_path}" chown_commands << "chown #{mount_uid}:#{mount_gid_old} #{expanded_guest_path}" From d68544a906b16e800b0ce5519d45cf892ae4699b Mon Sep 17 00:00:00 2001 From: Michael Hahn Date: Thu, 6 Feb 2014 14:06:47 -0800 Subject: [PATCH 2/2] Ensure options[:mount_options] is defined before checking if it includes key --- plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb b/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb index f098dc288..78984eec4 100644 --- a/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +++ b/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb @@ -64,7 +64,7 @@ module VagrantPlugins # Chown the directory to the proper user. We skip this if the # mount options contained a readonly flag, because it won't work. - if !options[:mount_options].include?("ro") + if options[:mount_options] and !options[:mount_options].include?("ro") chown_commands = [] chown_commands << "chown #{mount_uid}:#{mount_gid} #{expanded_guest_path}" chown_commands << "chown #{mount_uid}:#{mount_gid_old} #{expanded_guest_path}"