guests/linux: SMB mounts with symbol passwords work [GH-3202]
This commit is contained in:
parent
a6725710d3
commit
b20ff91784
|
@ -20,6 +20,7 @@ BUG FIXES:
|
||||||
public/private networks. [GH-3207]
|
public/private networks. [GH-3207]
|
||||||
- guests/linux: If SMB folder mounting fails, the password will no
|
- guests/linux: If SMB folder mounting fails, the password will no
|
||||||
longer be shown in plaintext in the output. [GH-3203]
|
longer be shown in plaintext in the output. [GH-3203]
|
||||||
|
- guests/linux: SMB mount works with passwords with symbols. [GH-3202]
|
||||||
- providers/hyperv: Check for PowerShell features. [GH-3398]
|
- providers/hyperv: Check for PowerShell features. [GH-3398]
|
||||||
- synced\_folders/smb: Only set the chmod properly by default on Windows
|
- synced\_folders/smb: Only set the chmod properly by default on Windows
|
||||||
if it isn't already set. [GH-3394]
|
if it isn't already set. [GH-3394]
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
require "shellwords"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module GuestLinux
|
module GuestLinux
|
||||||
module Cap
|
module Cap
|
||||||
|
@ -23,10 +25,12 @@ module VagrantPlugins
|
||||||
mount_gid_old = "`id -g #{options[:group]}`"
|
mount_gid_old = "`id -g #{options[:group]}`"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
smb_password = Shellwords.shellescape(options[:smb_password])
|
||||||
|
|
||||||
options[:mount_options] ||= []
|
options[:mount_options] ||= []
|
||||||
options[:mount_options] << "sec=ntlm"
|
options[:mount_options] << "sec=ntlm"
|
||||||
options[:mount_options] << "username=#{options[:smb_username]}"
|
options[:mount_options] << "username=#{options[:smb_username]}"
|
||||||
options[:mount_options] << "pass='#{options[:smb_password]}'"
|
options[:mount_options] << "pass='#{smb_password}'"
|
||||||
|
|
||||||
# First mount command uses getent to get the group
|
# First mount command uses getent to get the group
|
||||||
mount_options = "-o uid=#{mount_uid},gid=#{mount_gid}"
|
mount_options = "-o uid=#{mount_uid},gid=#{mount_gid}"
|
||||||
|
@ -62,7 +66,7 @@ module VagrantPlugins
|
||||||
attempts += 1
|
attempts += 1
|
||||||
if attempts > 10
|
if attempts > 10
|
||||||
command = mount_commands.join("\n")
|
command = mount_commands.join("\n")
|
||||||
command.gsub!(options[:smb_password], "PASSWORDHIDDEN")
|
command.gsub!(smb_password, "PASSWORDHIDDEN")
|
||||||
|
|
||||||
raise Vagrant::Errors::LinuxMountFailed,
|
raise Vagrant::Errors::LinuxMountFailed,
|
||||||
command: command
|
command: command
|
||||||
|
|
Loading…
Reference in New Issue