I know there are no tests here, I'm just unsure where they should go?
firstslip:puppet nigelk$ grep -ri suid spec/
spec/integration/bin/puppetmasterd.rb: args += " --user %s" %
Puppet::Util::SUIDManager.uid
spec/integration/bin/puppetmasterd.rb: args += " --group %s" %
Puppet::Util::SUIDManager.gid
spec/unit/indirector/ldap.rb: confine "Not running on culain as
root" => (Puppet::Util::SUIDManager.uid == 0 and
Facter.value("hostname") == "culain")
spec/unit/type/exec.rb:
Puppet::Util::SUIDManager.expects(:run_and_capture).with([command],
@user_name, @group_name).returns([output, status])
spec/unit/type/file/owner.rb:
Puppet::Util::SUIDManager.expects(:uid).returns 1
spec/unit/type/file/owner.rb:
Puppet::Util::SUIDManager.stubs(:uid).returns 0
spec/unit/type/file/source.rb:
Puppet::Util::SUIDManager.expects(:uid).returns 0
spec/unit/type/file/source.rb:
Puppet::Util::SUIDManager.expects(:uid).returns 0
spec/unit/type/file/source.rb:
Puppet::Util::SUIDManager.expects(:uid).returns 100
spec/unit/util/settings.rb:
Puppet::Util::SUIDManager.expects(:asuser).with("suser",
"sgroup").yields
On Mon, Mar 29, 2010 at 10:52 AM, Nigel Kersten <[email protected]> wrote:
>
> Signed-off-by: Nigel Kersten <[email protected]>
> ---
> lib/puppet/util/suidmanager.rb | 29 +++++++++++++++++++++++++++--
> 1 files changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/lib/puppet/util/suidmanager.rb b/lib/puppet/util/suidmanager.rb
> index a0a9178..8c31aee 100644
> --- a/lib/puppet/util/suidmanager.rb
> +++ b/lib/puppet/util/suidmanager.rb
> @@ -1,4 +1,3 @@
> -require 'facter'
> require 'puppet/util/warnings'
> require 'forwardable'
>
> @@ -6,14 +5,40 @@ module Puppet::Util::SUIDManager
> include Puppet::Util::Warnings
> extend Forwardable
>
> + # Note groups= is handled specially due to a bug in OS X 10.6
> to_delegate_to_process = [ :euid=, :euid, :egid=, :egid,
> - :uid=, :uid, :gid=, :gid, :groups=, :groups ]
> + :uid=, :uid, :gid=, :gid, :groups ]
>
> to_delegate_to_process.each do |method|
> def_delegator Process, method
> module_function method
> end
>
> + def osx_maj_ver
> + return @osx_maj_ver unless @osx_maj_ver.nil?
> + require 'facter'
> + # 'kernel' is available without explicitly loading all facts
> + if Facter.value('kernel') != 'Darwin'
> + �...@osx_maj_ver = false
> + return @osx_maj_ver
> + end
> + # But 'macosx_productversion_major' requires it.
> + Facter.loadfacts
> + �...@osx_maj_ver = Facter.value('macosx_productversion_major')
> + return @osx_maj_ver
> + end
> + module_function :osx_maj_ver
> +
> + def groups=(grouplist)
> + if osx_maj_ver == '10.6'
> + return true
> + else
> + return Process.groups = grouplist
> + module_function :groups= # what does this do?
> + end
> + end
> + module_function :groups=
> +
> if Facter['kernel'].value == 'Darwin'
> # Cannot change real UID on Darwin so we set euid
> alias :uid :euid
> --
> 1.7.0.3
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
>
--
nigel
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.