Sha256: 7bd7efddcdafcd27c47f539d9ad460055e1b6057aa05663ae5e980084e7fd51c

Contents?: true

Size: 572 Bytes

Versions: 16

Compression:

Stored size: 572 Bytes

Contents

require 'puppettest'

module PuppetTest
    # NOTE: currently both of these will produce bogus results on Darwin due to the wonderful
    # UID of nobody.
    def nonrootuser
        Etc.passwd { |user|
            if user.uid != Puppet::Util::SUIDManager.uid and user.uid > 0 and user.uid < 255
                return user
            end
        }
    end

    def nonrootgroup
        Etc.group { |group|
            if group.gid != Puppet::Util::SUIDManager.gid and group.gid > 0 and group.gid < 255
                return group
            end
        }
    end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
puppet-0.25.5 test/lib/puppettest/support/helpers.rb
puppet-0.25.4 test/lib/puppettest/support/helpers.rb
puppet-0.25.3 test/lib/puppettest/support/helpers.rb
puppet-0.24.9 test/lib/puppettest/support/helpers.rb
puppet-0.25.2 test/lib/puppettest/support/helpers.rb
puppet-0.25.1 test/lib/puppettest/support/helpers.rb
puppet-0.25.0 test/lib/puppettest/support/helpers.rb
puppet-0.24.0 test/lib/puppettest/support/helpers.rb
puppet-0.24.4 test/lib/puppettest/support/helpers.rb
puppet-0.24.3 test/lib/puppettest/support/helpers.rb
puppet-0.24.2 test/lib/puppettest/support/helpers.rb
puppet-0.24.1 test/lib/puppettest/support/helpers.rb
puppet-0.24.7 test/lib/puppettest/support/helpers.rb
puppet-0.24.5 test/lib/puppettest/support/helpers.rb
puppet-0.24.6 test/lib/puppettest/support/helpers.rb
puppet-0.24.8 test/lib/puppettest/support/helpers.rb