Merge pull request #3394 from Arxisos/master

synced_folders/rsync: enable override of default chmod flag
This commit is contained in:
Mitchell Hashimoto 2014-04-05 09:00:29 -07:00
commit 12ac7bc132
1 changed files with 7 additions and 2 deletions

View File

@ -72,9 +72,14 @@ module VagrantPlugins
args = Array(opts[:args]) if opts[:args]
args ||= ["--verbose", "--archive", "--delete", "-z"]
# On Windows, we have to set the chmod flag to avoid permission issues
if Vagrant::Util::Platform.windows?
# On Windows, we have to set a default chmod flag to avoid permission issues
if Vagrant::Util::Platform.windows? && !args.any? { |arg| arg.start_with?("--chmod=") }
#Ensures that all non-masked bits get enabled
args << "--chmod=ugo=rwX"
#Remove the -p option if --archive is enabled (--archive equals -rlptgoD)
#otherwise new files will not have the destination-default permissions
args << "--no-perms" if (args.include? "--archive") || (args.include? "-a")
end
# Build up the actual command to execute