Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-10857

User resource with forcelocal uses getent for groups

    XMLWordPrintable

Details

    • Night's Watch
    • 3
    • NW - 2021-02-03, NW - 2021-02-17
    • 42710
    • 1
    • Bug Fix
    • The `useradd` provider now checks the `forcelocal` parameter and gets local information about groups (from `/etc/groups`) and gid (from `/etc/passwd`) of a user when requested.
    • Needs Assessment

    Description

      *Description*
      When using the useradd provider with the user resource with forcelocal => true, the groups are still pulled from gentent. This causes LDAP/NIS groups to be detected instead of just the local groups.

      *Desired Behavior*
      The forcelocal => true parameter should force all options to be local. With the parameter set, the user is looked up from /etc/passwd. The groups should be looked up locally as well.

      *Actual Behavior*
      The forcelocal => true results in the user being looked up locally, but the groups are looked up through getgrent

      *Additional Notes*
      It falls back to using https://github.com/puppetlabs/puppet/blob/main/lib/puppet/util/posix.rb#L14-L33 from https://github.com/puppetlabs/puppet/blob/main/lib/puppet/provider/nameservice.rb#L235-L237 as it is not implemented in https://github.com/puppetlabs/puppet/blob/main/lib/puppet/provider/user/useradd.rb

      Attachments

        Issue Links

          Activity

            People

              luchian.nemes Luchian Nemes
              jarret.lavallee Jarret Lavallee
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support