summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2010-05-06 15:55:31 -0700
committerDaniel DeLeo <dan@opscode.com>2010-05-06 15:55:31 -0700
commit13c2cea6a753b4b132cf48545d9e0bf007066151 (patch)
tree1e7027d5460c720400f1952d0add6e8950e3c6c7
parent5c16bbe470ca6e47eb0b5904f3a50f84555d4aed (diff)
downloadchef-0.8.12.tar.gz
hotfix: only cd into / when dropping privs.0.8.12
-rw-r--r--chef/lib/chef/application.rb1
-rw-r--r--chef/lib/chef/daemon.rb2
-rw-r--r--chef/lib/chef/knife/cookbook_upload.rb2
3 files changed, 4 insertions, 1 deletions
diff --git a/chef/lib/chef/application.rb b/chef/lib/chef/application.rb
index a1bbcf0130..96825a8c01 100644
--- a/chef/lib/chef/application.rb
+++ b/chef/lib/chef/application.rb
@@ -47,7 +47,6 @@ class Chef::Application
# Always switch to a readable directory. Keeps subsequent Dir.chdir() {}
# from failing due to permissions when launched as a less privileged user.
- Dir.chdir("/")
end
# Reconfigure the application. You'll want to override and super this method.
diff --git a/chef/lib/chef/daemon.rb b/chef/lib/chef/daemon.rb
index eecdeb9607..1b9db3ba2b 100644
--- a/chef/lib/chef/daemon.rb
+++ b/chef/lib/chef/daemon.rb
@@ -121,6 +121,8 @@ class Chef
# Change process user/group to those specified in Chef::Config
#
def change_privilege
+ Dir.chdir("/")
+
if Chef::Config[:user] and Chef::Config[:group]
Chef::Log.info("About to change privilege to #{Chef::Config[:user]}:#{Chef::Config[:group]}")
_change_privilege(Chef::Config[:user], Chef::Config[:group])
diff --git a/chef/lib/chef/knife/cookbook_upload.rb b/chef/lib/chef/knife/cookbook_upload.rb
index 32bc9ec970..a289394ae3 100644
--- a/chef/lib/chef/knife/cookbook_upload.rb
+++ b/chef/lib/chef/knife/cookbook_upload.rb
@@ -38,6 +38,8 @@ class Chef
:description => "Upload all cookbooks, rather than just a single cookbook"
def run
+ Chef::Log.debug "Uploading cookbooks from #{config[:cookbook_path]}"
+
if config[:cookbook_path]
Chef::Config[:cookbook_path] = config[:cookbook_path]
else