guests/linux: exclude symlinks from chown search [GH-3744]

This commit is contained in:
Mitchell Hashimoto 2014-05-09 16:08:02 -07:00
parent ca6e2393bd
commit c7abea2032
2 changed files with 5 additions and 2 deletions

View File

@ -21,6 +21,7 @@ BUG FIXES:
same name as a real directory. [GH-3732]
- core: Parallelization is more stable, doesn't crash due to to
bad locks. [GH-3735]
- guests/linux: Rsync chown ignores symlinks. [GH-3744]
- guests/openbsd: Remove '-v' flag from chown for rsync. [GH-3743]
- provisioners/shell: Fix shell provisioner config validation when the
`binary` option is set to false [GH-3712]

View File

@ -18,8 +18,10 @@ module VagrantPlugins
def self.rsync_post(machine, opts)
machine.communicate.sudo(
"find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +
"xargs -0 -r chown -v #{opts[:owner]}:#{opts[:group]}")
"find '#{opts[:guestpath]}' " +
"'!' -type l -a " +
"'(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +
"xargs -0 -r chown #{opts[:owner]}:#{opts[:group]}")
end
end
end