Skip to content

(PUP-10896) Fix gid idempotency on user resource #8511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

GabrielNagy
Copy link
Contributor

This is a regression of #8501 which made forcelocal act different when
setting the gid parameter.

Since we were returning the GID of an user as a string, Puppet made the
assumption that the GID wasn't a number. This caused issues when setting
gid to a string value (like gid => 'abc'), which is allowed in Puppet.

To fix this, ensure we return the GID as integer after searching
/etc/passwd. If for some reason it cannot be converted, it is returned
as is (highly unlikely as non-numeric GIDs are not allowed in
/etc/passwd).

This is a regression of puppetlabs#8501 which made `forcelocal` act different when
setting the `gid` parameter.

Since we were returning the GID of an user as a string, Puppet made the
assumption that the GID wasn't a number. This caused issues when setting
gid to a string value (like `gid => 'abc'`), which is allowed in Puppet.

To fix this, ensure we return the GID as integer after searching
`/etc/passwd`. If for some reason it cannot be converted, it is returned
as is (highly unlikely as non-numeric GIDs are not allowed in
`/etc/passwd`).
@GabrielNagy GabrielNagy requested review from a team February 10, 2021 16:33
@ciprianbadescu ciprianbadescu merged commit 428b97b into puppetlabs:7.4.1_release Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants