Details
-
Improvement
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
PUP 6.19.1
-
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