diff options
author | Tim Sogard <src@timsogard.com> | 2014-11-03 18:32:21 -0800 |
---|---|---|
committer | Bryan McLellan <btm@chef.io> | 2015-03-27 08:51:42 -0400 |
commit | 551ec22e7b8fe240a111f7124d820ff64299283f (patch) | |
tree | 05855a9a7624b12b90a034c6ccb8d4031ae4e485 /lib | |
parent | 7a6df304226d55d73dcc0c8b5082e39811e100b9 (diff) | |
download | chef-551ec22e7b8fe240a111f7124d820ff64299283f.tar.gz |
Reset $HOME to user running chef-client when running via sudo
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/knife/bootstrap.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 64d1d0c378..a4095e8402 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -378,7 +378,7 @@ class Chef command = render_template if config[:use_sudo] - command = config[:use_sudo_password] ? "echo '#{config[:ssh_password]}' | sudo -S #{command}" : "sudo #{command}" + command = config[:use_sudo_password] ? "echo '#{config[:ssh_password]}' | sudo -SH #{command}" : "sudo -H #{command}" end command |