core: test file writes for home dir perms

Creating directories for some reason was allowed in Windows, but writes
would fail later.
This commit is contained in:
Mitchell Hashimoto 2014-01-15 11:18:19 -08:00
parent aabe5124c4
commit 8652d87865
2 changed files with 13 additions and 0 deletions

View File

@ -53,6 +53,8 @@ BUG FIXES:
syntax errors. syntax errors.
- core: Plugins that fork within certain actions will no longer hang - core: Plugins that fork within certain actions will no longer hang
indefinitely. [GH-2756] indefinitely. [GH-2756]
- core: Windows checks home directory permissions more correctly to
warn of potential issues.
- commands/box: Box add `--force` works with `--provider` flag. [GH-2757] - commands/box: Box add `--force` works with `--provider` flag. [GH-2757]
- commands/plugin: Plugin installation will fail if dependencies conflict, - commands/plugin: Plugin installation will fail if dependencies conflict,
rather than at runtime. rather than at runtime.

View File

@ -621,6 +621,17 @@ module Vagrant
end end
end end
# Attempt to write into the home directory to verify we can
begin
path = @home_path.join("perm_test")
path.open("w") do |f|
f.write("hello")
end
path.unlink
rescue Errno::EACCES
raise Errors::HomeDirectoryNotAccessible, home_path: @home_path.to_s
end
# Create the version file to mark the version of the home directory # Create the version file to mark the version of the home directory
# we're using. # we're using.
version_file = @home_path.join("setup_version") version_file = @home_path.join("setup_version")