Method: Chef::Provider::User::Solaris#check_lock

Defined in:
lib/chef/provider/user/solaris.rb

#check_lockObject



48
49
50
51
52
53
54
55
56
57
# File 'lib/chef/provider/user/solaris.rb', line 48

def check_lock
  user = TargetIO::IO.read(PASSWORD_FILE).match(/^#{Regexp.escape(new_resource.username)}:([^:]*):/)

  # If we're in whyrun mode, and the user is not created, we assume it will be
  return false if whyrun_mode? && user.nil?

  raise Chef::Exceptions::User, "Cannot determine if #{new_resource} is locked!" if user.nil?

  @locked = user[1].start_with?("*LK*")
end