From a6725710d3631fa971541d1ce370e701792bc039 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 9 Apr 2014 10:42:39 -0700 Subject: [PATCH] guests/linux: don't show SMB password in plaintext on error [GH-3203] --- CHANGELOG.md | 2 ++ plugins/guests/linux/cap/mount_smb_shared_folder.rb | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbf839f22..7e43589ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ BUG FIXES: - guests/fedora: Fix hostname setting. [GH-3382] - guests/fedora: Support predictable network interface names for public/private networks. [GH-3207] + - guests/linux: If SMB folder mounting fails, the password will no + longer be shown in plaintext in the output. [GH-3203] - providers/hyperv: Check for PowerShell features. [GH-3398] - synced\_folders/smb: Only set the chmod properly by default on Windows if it isn't already set. [GH-3394] diff --git a/plugins/guests/linux/cap/mount_smb_shared_folder.rb b/plugins/guests/linux/cap/mount_smb_shared_folder.rb index 88baa8fcc..ffafe1e3e 100644 --- a/plugins/guests/linux/cap/mount_smb_shared_folder.rb +++ b/plugins/guests/linux/cap/mount_smb_shared_folder.rb @@ -61,8 +61,11 @@ module VagrantPlugins attempts += 1 if attempts > 10 + command = mount_commands.join("\n") + command.gsub!(options[:smb_password], "PASSWORDHIDDEN") + raise Vagrant::Errors::LinuxMountFailed, - command: mount_commands.join("\n") + command: command end sleep 2