Fix #11439: Quote each exported directory (#11441)

This commit changes the Darwin NFS template for /etc/exports to put each
exported directory in quotes.

This fixes an issue with directory names that have spaces in them.
Quotes were chosen (rather than escaping the spaces) in order to match
the template for Linux NFS exports.
This commit is contained in:
Jeff Bonhag 2020-03-09 16:02:03 -04:00 committed by GitHub
parent 7b43402b3c
commit 1678cfa757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
# VAGRANT-BEGIN: <%= user %> <%= uuid %> # VAGRANT-BEGIN: <%= user %> <%= uuid %>
<% folders.each do |dirs, opts| %> <% folders.each do |dirs, opts| %>
<% dirs.each do |d| %> <% dirs.each do |d| %>
<%= d %> <%=opts[:bsd__compiled_nfs_options] %> <%= ips.join(" ") %> "<%= d %>" <%=opts[:bsd__compiled_nfs_options] %> <%= ips.join(" ") %>
<% end %> <% end %>
<% end %> <% end %>
# VAGRANT-END: <%= user %> <%= uuid %> # VAGRANT-END: <%= user %> <%= uuid %>

View File

@ -37,7 +37,7 @@ describe "templates/nfs/exports_darwin" do
}) })
expect(result).to eq <<-EOH.gsub(/^ {8}/, "") expect(result).to eq <<-EOH.gsub(/^ {8}/, "")
# VAGRANT-BEGIN: 501 UUID # VAGRANT-BEGIN: 501 UUID
/vagrant -alldirs -mapall=501:80 172.16.0.2 "/vagrant" -alldirs -mapall=501:80 172.16.0.2
# VAGRANT-END: 501 UUID # VAGRANT-END: 501 UUID
EOH EOH
end end
@ -59,8 +59,8 @@ describe "templates/nfs/exports_darwin" do
}) })
expect(result).to eq <<-EOH.gsub(/^ {8}/, "") expect(result).to eq <<-EOH.gsub(/^ {8}/, "")
# VAGRANT-BEGIN: 501 UUID # VAGRANT-BEGIN: 501 UUID
/vagrant -alldirs -mapall=501:80 172.16.0.2 "/vagrant" -alldirs -mapall=501:80 172.16.0.2
/vagrant/other -alldirs -mapall=501:80 172.16.0.2 "/vagrant/other" -alldirs -mapall=501:80 172.16.0.2
# VAGRANT-END: 501 UUID # VAGRANT-END: 501 UUID
EOH EOH
end end