core: safer dup checks for synced folders

This commit is contained in:
Mitchell Hashimoto 2014-03-03 20:38:59 -08:00
parent 4437bcd77f
commit c098a3296b
1 changed files with 6 additions and 2 deletions

View File

@ -36,8 +36,12 @@ module Vagrant
{}.tap do |result|
env.each do |k, v|
if k.to_s.start_with?("#{name}_")
k = k.dup if !k.is_a?(Symbol)
v = v.dup if !v.is_a?(Symbol)
# While I generally don't like the 'rescue' syntax,
# we do this to just fall back to the default value
# if it isn't dup-able.
k = k.dup rescue k
v = v.dup rescue v
result[k] = v
end
end