Merge pull request #9734 from chrisroberts/f-win-smb-mount

Default SMB version to 2.0 for linux guest mounts on Windows hosts
This commit is contained in:
Chris Roberts 2018-04-26 14:48:01 -07:00 committed by GitHub
commit d2ec4d9312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -17,6 +17,12 @@ module VagrantPlugins
true
end
# Required options for mounting a share hosted on Windows
# NOTE: Windows deprecated smb 1.0 so a minimum of 2.0 must be enabled
def self.smb_mount_options(env)
["vers=2.0"]
end
def self.smb_validate_password(env, machine, username, password)
script_path = File.expand_path("../../scripts/check_credentials.ps1", __FILE__)
args = []

View File

@ -46,7 +46,7 @@ module VagrantPlugins
Cap::SMB
end
host_capability("windows", "smb_cleanup") do
host_capability("windows", "smb_mount_options") do
require_relative "cap/smb"
Cap::SMB
end

View File

@ -34,6 +34,14 @@ Description : Not Vagrant Owned
allow(subject).to receive(:sleep)
end
describe ".smb_mount_options" do
it "should provide smb version of at least 2" do
result = subject.smb_mount_options(nil)
ver = result.detect{|i| i.start_with?("vers") }.to_s.split("=", 2).last.to_s.to_i
expect(ver).to be >= 2
end
end
describe ".smb_installed" do
context "when powershell version is greater than 2" do
it "is valid installation" do