synced_folders/smb: test for admin privileges

This commit is contained in:
Mitchell Hashimoto 2014-02-26 16:02:33 -08:00
parent a50421c54c
commit dd6f1083b0
3 changed files with 14 additions and 0 deletions

View File

@ -21,6 +21,10 @@ module VagrantPlugins
class WindowsHostRequired < SMBError
error_key(:windows_host_required)
end
class WindowsAdminRequired < SMBError
error_key(:windows_admin_required)
end
end
end
end

View File

@ -20,6 +20,11 @@ module VagrantPlugins
return false
end
if !Vagrant::Util::Platform.windows_admin?
raise Errors::WindowsAdminRequired if raise_error
return false
end
true
end

View File

@ -37,6 +37,11 @@ en:
Error:
%{stderr}
windows_admin_required: |-
SMB shared folders require running Vagrant with administrative
privileges. This is a limitation of Windows, since creating new
network shares requires admin privileges. Please try again in a
console with proper permissions or use another synced folder type.
windows_host_required: |-
SMB shared folders are only available when Vagrant is running
on Windows. The guest machine can be running non-Windows. Please use