summaryrefslogtreecommitdiff
path: root/lib/chef/provider/user
diff options
context:
space:
mode:
authorTom Duffield <tom@chef.io>2016-10-31 12:30:17 -0500
committerTom Duffield <tom@chef.io>2016-10-31 12:53:26 -0500
commita47b1840e6c7b356b79bd535033ba4cf50231bc3 (patch)
treec58ee90b784b98052bdd77a067fbb730139ca05d /lib/chef/provider/user
parent1738bd548fe1227017f3fbd093fcf13f5c194bad (diff)
downloadchef-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.rb2
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