puppetlabs/puppet — pull request #1306 by glarizza (2012-11-30 22:41:10+00:00)
Title: [12833] Fix edge case with directoryservice user provider

An edge-case was found where if:

* A machine had been upgraded from 10.6 through the series to 10.8
* A user existed on the machine when it was on OS X version 10.6
* That user STILL exists in 10.8 but has never logged in
* That user still has the old 10.6-style password hash
* Puppet attempted to set the password to a new value

Puppet would throw errors. This was because Puppet assumed, based on the OS, that the user would have a specific structure (and, thus, a ShadowHashData key in the user's plist). Because this user still has the old-style password hash, this isn't the case.

This series of commits fixes this behavior, adds helper methods to clean up the codebase, and adds tests to catch the behavior in the future.