HomePhorge

(#9459) Fix problems with Windows 'user' and 'group' providers.
122b8c287947Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#9459) Fix problems with Windows 'user' and 'group' providers.

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. It also had the same
problem when creating a new group and trying to add members to it,
before the underlying ADSI group object was saved.

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. Added expectation
sequence to ensure newly created users and groups are committed before
making the ADSI connection.

Details

Provenance
Cameron Thomas <cameron@puppetlabs.com>Authored on
Josh Cooper <josh@puppetlabs.com>Committed on Sep 29 2011, 1:18 AM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUd1b631b35aa5: Merge pull request #112 from joshcooper/ticket/2.7.x/8410-waitpid2-on-windows
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU122b8c287947: (#9459) Fix problems with Windows 'user' and 'group' providers. (authored by Cameron Thomas <cameron@puppetlabs.com>).Sep 29 2011, 1:18 AM