From 78ef3ded2b9c846458046b943470abba30cbed75 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 10 Jul 2013 20:21:13 -0700 Subject: [PATCH] Expand symlinks for NFS host path [GH-1101] --- CHANGELOG.md | 2 ++ lib/vagrant/action/builtin/nfs.rb | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da8dca7e..aa98b7d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ BUG FIXES: may be in the box itself. [GH-1061] - NFS synced folders exporting sub-directories of other exported folders now works properly. [GH-785] + - NFS shared folders properly dereference symlinks so that the real path + is used, avoiding mount errors [GH-1101] ## 1.2.3 (July 9, 2013) diff --git a/lib/vagrant/action/builtin/nfs.rb b/lib/vagrant/action/builtin/nfs.rb index 17db963b2..eaaf2899a 100644 --- a/lib/vagrant/action/builtin/nfs.rb +++ b/lib/vagrant/action/builtin/nfs.rb @@ -37,7 +37,9 @@ module Vagrant # Expand the host path, create it if we have to and # store away the folder. - hostpath = Pathname.new(opts[:hostpath]).expand_path(env[:root_path]) + hostpath = Pathname.new(opts[:hostpath]). + expand_path(env[:root_path]). + realpath if !hostpath.directory? && opts[:create] # Host path doesn't exist, so let's create it.