puppetlabs/puppet — pull request #979 by kdreyer-usgs (2012-07-27 21:45:17+00:00)
Title: (#7442) solaris password max age

On Solaris, the following manifest will be re-applied on every run:

user { "kdreyer":
password_max_age => "-1",
}

$ puppet apply test.pp
notice: /Stage[main]//User[kdreyer]/password_max_age: password_max_age changed '' to '-1'
notice: Finished catalog run in 0.13 seconds

$ puppet apply test.pp
notice: /Stage[main]//User[kdreyer]/password_max_age: password_max_age changed '' to '-1'
notice: Finished catalog run in 0.13 seconds

"-1" is the correct argument to pass to the "passwd -x" command, but passord_max_age needs to be "smarter" to handle the value from a manifest. It should not return nil when there is no password expiration for a user.

I also attached two tests for password_max_age. The first test verifies basic expiration functionality and passes with the current code in master. The second test checks that password_max_age returns -1 when password expiration has been disabled in /etc/shadow. It fails with the current code in master, and passes after password_max_age has been patched.