diff options
author | Matthew Kent <mkent@magoazul.com> | 2009-04-10 17:36:58 -0700 |
---|---|---|
committer | Matthew Kent <mkent@magoazul.com> | 2009-04-14 22:57:33 -0700 |
commit | 47a51b6a0f05cfe9ee949a5004e88f474639ba48 (patch) | |
tree | 293f1ccd6d56a10b97037944711ba2571e168689 /chef | |
parent | 2b8efe384d39f64049fa9c3ecb609d02c619892b (diff) | |
download | chef-47a51b6a0f05cfe9ee949a5004e88f474639ba48.tar.gz |
drop privileges prior to writing logs
Diffstat (limited to 'chef')
-rwxr-xr-x | chef/bin/chef-client | 2 | ||||
-rw-r--r-- | chef/lib/chef/daemon.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/chef/bin/chef-client b/chef/bin/chef-client index df06e068fd..1c1b38bd19 100755 --- a/chef/bin/chef-client +++ b/chef/bin/chef-client @@ -79,6 +79,8 @@ end Chef::Config.from_file(config[:config_file]) Chef::Config.configure { |c| c.merge!(config) } +Chef::Daemon.change_privilege + if Chef::Config[:daemonize] unless Chef::Config[:log_location].is_a? IO Chef::Log.init(Chef::Config[:log_location]) diff --git a/chef/lib/chef/daemon.rb b/chef/lib/chef/daemon.rb index 7ab66ab710..1b4d770207 100644 --- a/chef/lib/chef/daemon.rb +++ b/chef/lib/chef/daemon.rb @@ -40,7 +40,6 @@ class Chef exit if fork Process.setsid exit if fork - change_privilege Chef::Log.info("Forked, in #{Process.pid}. Priveleges: #{Process.euid} #{Process.egid}") File.umask 0000 $stdin.reopen("/dev/null") |