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

User resource with forcelocal uses getent for groups

    XMLWordPrintable

    Details

    • Template:
    • Agent OS:
      RHEL 7 (x86_64)
    • Team:
      Night's Watch
    • Story Points:
      3
    • Sprint:
      NW - 2021-02-03, NW - 2021-02-17
    • Zendesk Ticket IDs:
      42710
    • Zendesk Ticket Count:
      1
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      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.
    • QA Risk Assessment:
      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

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

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support