summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-08-29 06:10:48 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-08-29 06:10:48 +0000
commita46a620486b106ffc8e653b48a1de58ca6a64933 (patch)
tree8c1e4f65ff14bea577e92d4ae3152977103016c4 /lib
parenta53d8407e78b447d26fa10cc482b0dd55dc3bd9d (diff)
downloadpuppet-a46a620486b106ffc8e653b48a1de58ca6a64933.tar.gz
puppet-a46a620486b106ffc8e653b48a1de58ca6a64933.tar.xz
puppet-a46a620486b106ffc8e653b48a1de58ca6a64933.zip
disabling chuser on os x, since it is broken with < ruby 1.8.5
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1514 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/util.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index 3352974e0..53ffe903a 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -98,6 +98,10 @@ module Util
# Change the process to a different user
def self.chuser
+ if Facter["operatingsystem"].value == "Darwin"
+ $stderr.puts "Ruby on darwin is broken; puppetmaster must run as root"
+ return
+ end
if group = Puppet[:group]
group = self.gid(group)
unless group
@@ -107,9 +111,14 @@ module Util
begin
Process.egid = group
Process.gid = group
- rescue
- $stderr.puts "could not change to group %s" % group
- exit(74)
+ rescue => detail
+ Puppet.warning "could not change to group %s: %s" %
+ [group.inspect, detail]
+ $stderr.puts "could not change to group %s" % group.inspect
+
+ # Don't exit on failed group changes, since it's
+ # not fatal
+ #exit(74)
end
end
end
@@ -121,7 +130,6 @@ module Util
end
unless Process.uid == user
begin
- Process.euid = user
Process.uid = user
rescue
$stderr.puts "could not change to user %s" % user