summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Sogard <src@timsogard.com>2014-11-03 18:32:21 -0800
committerBryan McLellan <btm@chef.io>2015-03-27 08:51:42 -0400
commit551ec22e7b8fe240a111f7124d820ff64299283f (patch)
tree05855a9a7624b12b90a034c6ccb8d4031ae4e485 /lib
parent7a6df304226d55d73dcc0c8b5082e39811e100b9 (diff)
downloadchef-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.rb2
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