synced_folders/smb: test for admin privileges
This commit is contained in:
parent
a50421c54c
commit
dd6f1083b0
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue