Skip to content

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

Merged
ciprianbadescu merged 1 commit intopuppetlabs:7.4.1_releasefrom
GabrielNagy:fix-gid-idempotency-main
Feb 10, 2021
Merged

(PUP-10896) Fix gid idempotency on user resource#8511
ciprianbadescu merged 1 commit intopuppetlabs:7.4.1_releasefrom
GabrielNagy:fix-gid-idempotency-main

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