Ensure rsync_post has find permissions on smartos

This commit is contained in:
Eric Saxby 2014-08-29 14:15:18 -07:00
parent 8cd2e58194
commit dd77295533
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ module VagrantPlugins
end end
def self.rsync_post(machine, opts) def self.rsync_post(machine, opts)
machine.communicate.execute("find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " + machine.communicate.execute("#{machine.config.smartos.suexec_cmd} find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -or ! -group #{opts[:group]} ')' -print0 | " +
"#{machine.config.smartos.suexec_cmd} xargs -0 chown #{opts[:owner]}:#{opts[:group]}") "#{machine.config.smartos.suexec_cmd} xargs -0 chown #{opts[:owner]}:#{opts[:group]}")
end end
end end

View File

@ -40,7 +40,7 @@ describe "VagrantPlugins::VagrantPlugins::Cap::Rsync" do
describe ".rsync_post" do describe ".rsync_post" do
it 'chowns incorrectly owned files in sync dir' do it 'chowns incorrectly owned files in sync dir' do
communicator.expect_command("find '/sync_dir' '(' ! -user somebody -or ! -group somegroup ')' -print0 | pfexec xargs -0 chown somebody:somegroup") communicator.expect_command("pfexec find '/sync_dir' '(' ! -user somebody -or ! -group somegroup ')' -print0 | pfexec xargs -0 chown somebody:somegroup")
plugin.rsync_post(machine, guestpath: '/sync_dir', owner: 'somebody', group: 'somegroup') plugin.rsync_post(machine, guestpath: '/sync_dir', owner: 'somebody', group: 'somegroup')
end end
end end