Skip to content

Commit

Permalink
Change password_max_age lower bounds to negative one (-1) to allow fo…
Browse files Browse the repository at this point in the history
…r disabling of password expiry.
  • Loading branch information
bschonec committed Oct 16, 2023
1 parent fe94d64 commit d284db5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Allows strings up to 32 characters long that begin with a lower case letter or u

#### `Accounts::User::PasswordMaxAge`

Maximum number of days a password may be used before it must be changed. Allows any integer from `0` to `99999`. See [`user`](https://puppet.com/docs/puppet/latest/types/user.html#user-attribute-password_max_age) resource.
Maximum number of days a password may be used before it must be changed. Allows any integer from `-1` to `99999`. See [`user`](https://puppet.com/docs/puppet/latest/types/user.html#user-attribute-password_max_age) resource.

#### `Accounts::User::Resource`

Expand Down
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ Default value: `'!!'`
Data type: `Optional[Accounts::User::PasswordMaxAge]`

Maximum number of days a password may be used before it must be changed.
Allows any integer from `0` to `99999`. See the
Allows any integer from `-1` to `99999`. See the
[`user`](https://puppet.com/docs/puppet/latest/types/user.html#user-attribute-password_max_age)
resource.

Expand Down
2 changes: 1 addition & 1 deletion manifests/user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
#
# @param password_max_age
# Maximum number of days a password may be used before it must be changed.
# Allows any integer from `0` to `99999`. See the
# Allows any integer from `-1` to `99999`. See the
# [`user`](https://puppet.com/docs/puppet/latest/types/user.html#user-attribute-password_max_age)
# resource.
#
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/accounts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'hunner' => {
'groups' => ['root'],
'password' => 'hi',
'password_max_age' => 30,
'password_max_age' => 60,
'shell' => '/bin/true',
'home' => '/test/hunner',
'managevim' => false,
Expand All @@ -63,7 +63,7 @@
'sshkey_group' => 'root',
'groups' => ['root'],
'password' => 'hi',
'password_max_age' => 30,
'password_max_age' => 60,
'shell' => '/bin/true',
'home' => '/test/hunner',
'managevim' => false,
Expand Down Expand Up @@ -323,7 +323,7 @@
expect(user('hunner')).to have_login_shell '/bin/true'
expect(user('hunner')).to have_home_directory '/test/hunner'
expect(user('hunner')).to contain_password 'hi' unless os[:family] == 'solaris'
expect(user('hunner').maximum_days_between_password_change).to match 30
expect(user('hunner').maximum_days_between_password_change).to match 45

expect(file('/test/hunner')).to be_directory
expect(file('/test/hunner')).to be_mode 700
Expand Down
2 changes: 1 addition & 1 deletion types/user/passwordmaxage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# On most systems, the default value of 99999 is about 274 years, which
# effectively disables password aging.
#
type Accounts::User::PasswordMaxAge = Integer[1, 99999]
type Accounts::User::PasswordMaxAge = Integer[-1, 99999]

0 comments on commit d284db5

Please sign in to comment.