(#9459) Fix problems with Windows 'user' and 'group' providers.#116
Closed
ChaseMotorman wants to merge 1 commit intopuppetlabs:2.7.xfrom
ChaseMotorman:ticket/2.7.x/9459-user-group-failures
Closed
(#9459) Fix problems with Windows 'user' and 'group' providers.#116ChaseMotorman wants to merge 1 commit intopuppetlabs:2.7.xfrom ChaseMotorman:ticket/2.7.x/9459-user-group-failures
ChaseMotorman wants to merge 1 commit intopuppetlabs:2.7.xfrom
ChaseMotorman:ticket/2.7.x/9459-user-group-failures
Conversation
This commit corrects several problems with the Windows 'user' and 'group' providers, Puppet::Util::ADSI helper class. The 'user' provider failed to add the username to the set of groups specified in the 'groups' property when creating a new user, due to the provider trying to enumerate a user's group membership before the underlying ADSI user object was saved. Any group referenced in the property must exist prior to creating the resource. The 'group' provider failed to save a newly-created resource, due to a missing 'flush' method, which in turn calls the 'Puppet::Util::ADSI.commit' (save) method. Windows does not allow user and groups to share the same name, and when attempted the ADSI connection would throw a misleading exception referring to an 'invalid moniker'. The 'user' provider will now raise an error if it attempts to create a resource when a like-named group already exists, and vice-versa. Spec tests were updated to reflect code changes.
Contributor
|
I've created a new pull request that adds back the rescue nil block. #141 That code is necessary because the user's groups method can be invoked in order to determine if the user currently belongs to any groups, and depending on the membership property, whether the user should be removed from those groups. We also figured out the failure was due to some old code in the site ruby directory. |
hlindberg
pushed a commit
to hlindberg/puppet
that referenced
this pull request
Oct 16, 2014
404 Cleanups and New 404 Page
melissa
pushed a commit
to melissa/puppet
that referenced
this pull request
Mar 30, 2018
(PCP-49) Removing PIDFile lock functionality temporarily
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit corrects several problems with the Windows 'user' and
'group' providers, and Puppet::Util::ADSI helper class.
The 'user' provider failed to add the username to the set of groups
specified in the 'groups' property when creating a new user, due to
the provider trying to enumerate a user's group membership before the
underlying ADSI user object was saved. Any group referenced in the
property must exist prior to creating the resource.
The 'group' provider failed to save a newly-created resource,
due to a missing 'flush' method, which in turn calls the
'Puppet::Util::ADSI.commit' (save) method.
Windows does not allow user and groups to share the same name,
and when attempted the ADSI connection would throw a misleading
exception referring to an 'invalid moniker'. The 'user' provider will
now raise an error if it attempts to create a resource when a like-named
group already exists, and vice-versa.