diff options
author | Tom Duffield <tom@chef.io> | 2016-10-31 12:30:17 -0500 |
---|---|---|
committer | Tom Duffield <tom@chef.io> | 2016-10-31 12:53:26 -0500 |
commit | a47b1840e6c7b356b79bd535033ba4cf50231bc3 (patch) | |
tree | c58ee90b784b98052bdd77a067fbb730139ca05d /lib/chef/provider/user | |
parent | 1738bd548fe1227017f3fbd093fcf13f5c194bad (diff) | |
download | chef-a47b1840e6c7b356b79bd535033ba4cf50231bc3.tar.gz |
Solaris users are locked only if *LK*COOL-413/getent-on-solaris-doesnt-work
According to `man shadow` on Solaris 10 and 11, an account is only
locked if the first four characters in the password field are
`*LK*`. The same is true for SmartOS (the OS for which the initial code
was contributed).
Signed-off-by: Tom Duffield <tom@chef.io>
Diffstat (limited to 'lib/chef/provider/user')
-rw-r--r-- | lib/chef/provider/user/solaris.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/user/solaris.rb b/lib/chef/provider/user/solaris.rb index 7bd944ed1c..7aa0ceb93a 100644 --- a/lib/chef/provider/user/solaris.rb +++ b/lib/chef/provider/user/solaris.rb @@ -53,7 +53,7 @@ class Chef raise Chef::Exceptions::User, "Cannot determine if #{@new_resource} is locked!" if user.nil? - @locked = !!(user[1] =~ /^\*?LK\*?/) + @locked = user[1].start_with?("*LK*") end def lock_user |