Bug #11717

Windows ADSI user provider won't create users if a password policy is in place

Added by Paul Tinsley 4 months ago. Updated 4 months ago.

Status:Closed Start date:01/03/2012
Priority:Normal Due date:
Assignee:Josh Cooper % Done:

0%

Category:windows
Target version:2.7.10
Affected Puppet version:2.7.9 Branch:https://github.com/puppetlabs/puppet/pull/304
Keywords:
Votes: 0

Description

The creation of a user in puppet currently creates the account then sets the password, that won’t meet the complexity requirement since the password is blank. It’s the same behavior you would receive if you went into computer manager and added one by hand with no password. As the provider is currently written this requires a one line code change:

$ diff /cygdrive/c/Users/puppet/Desktop/puppetlabs-puppet-26093a8/lib/puppet/provider/user/windows_adsi.rb puppet/provider/user/windows_adsi.rb
25c25,28
<     @user.commit
---
>     #if a windows complexity policy is set you have to set the password when the
>     # account is created, a call to .password is all that is needed it does it's
>     # own commit.
>     @user.password = @resource[:password]

I can’t certify this will work in every environment but I have had luck in windows 7 and windows 2003 r2.

History

Updated by Paul Tinsley 4 months ago

the syntax of the diff got borked, here’s a pastie link with the same: http://pastie.org/3122766

Updated by Josh Cooper 4 months ago

  • Description updated (diff)
  • Status changed from Unreviewed to Accepted
  • Assignee set to Josh Cooper
  • Target version set to 2.7.x

Thanks Paul

Updated by Carl Caum 4 months ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to http://github.com/puppetlabs/puppet/pull/303

Updated by Carl Caum 4 months ago

  • Branch changed from http://github.com/puppetlabs/puppet/pull/303 to https://github.com/puppetlabs/puppet/pull/304

Updated by Josh Cooper 4 months ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release

This was merged in commit https://github.com/puppetlabs/puppet/commit/9ba85db04b1712e620a4acb410d23d52c109d4de.

    (#11717) Set password before creating user on Windows
    
    Previously, puppet could not create a user with no password when a
    local password complexity policy was set. This commit sets the
    password on the user prior to creating it, and updates the spec tests
    accordingly.

Updated by Josh Cooper 4 months ago

  • Target version changed from 2.7.x to 2.7.10

Updated by Michael Stahnke 4 months ago

  • Status changed from Merged - Pending Release to Closed

released in 2.7.10rc1

Also available in: Atom PDF