synced_folders/rsync: enable override of default chmod flag
fixed new file creation to follow guest's umask on Windows by default
This commit is contained in:
parent
6a7c25f198
commit
32f25b6a0d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue