From ea983e32c86253f6bb1416050cbd55f187ebf7eb Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 24 Oct 2014 12:16:53 -0700 Subject: [PATCH] hosts/*: NFS prune regexp matches file paths [GH-3815] --- CHANGELOG.md | 1 + plugins/hosts/bsd/cap/nfs.rb | 2 +- plugins/hosts/linux/cap/nfs.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d110ea2c..ebe6119fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,7 @@ BUG FIXES: - provisioners/shell: Retry getting SSH info a few times. [GH-3924] - provisioners/shell: PowerShell scripts can have args. [GH-4548] - synced\_folders/nfs: Don't modify NFS exports file if no exports. [GH-4619] + - synced\_folders/nfs: Prune exports for file path IDs. [GH-3815] PLUGIN AUTHOR CHANGES: diff --git a/plugins/hosts/bsd/cap/nfs.rb b/plugins/hosts/bsd/cap/nfs.rb index 6042320ae..b154ad19c 100644 --- a/plugins/hosts/bsd/cap/nfs.rb +++ b/plugins/hosts/bsd/cap/nfs.rb @@ -137,7 +137,7 @@ module VagrantPlugins user = Process.uid File.read("/etc/exports").lines.each do |line| - if id = line[/^# VAGRANT-BEGIN:( #{user})? ([A-Za-z0-9-]+?)$/, 2] + if id = line[/^# VAGRANT-BEGIN:( #{user})? ([\.\/A-Za-z0-9-_]+?)$/, 2] if valid_ids.include?(id) logger.debug("Valid ID: #{id}") else diff --git a/plugins/hosts/linux/cap/nfs.rb b/plugins/hosts/linux/cap/nfs.rb index 1216ce04f..c5435fff5 100644 --- a/plugins/hosts/linux/cap/nfs.rb +++ b/plugins/hosts/linux/cap/nfs.rb @@ -71,7 +71,7 @@ module VagrantPlugins user = Process.uid File.read("/etc/exports").lines.each do |line| - if id = line[/^# VAGRANT-BEGIN:( #{user})? ([A-Za-z0-9-]+?)$/, 2] + if id = line[/^# VAGRANT-BEGIN:( #{user})? ([\.\/A-Za-z0-9-_]+?)$/, 2] if valid_ids.include?(id) logger.debug("Valid ID: #{id}") else